[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC 1/6] x86/ioapic: set disable hook for masking edge interrupts


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 3 Jun 2022 15:19:34 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bvziG45W3IYoT6P5Sf/XiRelkbBtO0LL+8k2buESsbs=; b=KlRjZ+IJyzR2q1JnNcoWZaJBQ03Iu0KFky0dwAvmOoCgYKvW4ZHeGsbbaGQQkc9yXm58G5WCVGc3Jiu/X8V09FqbmVON8QrPW8QmHcjmelwbhVn7FfULbs2vDp8nQ35Dbr0lzYnflyUW+VAo5aa0nZDbhBb0Zr2zFgEOzeTPCsR5rI2YfGPKpayOjuIlfJifOMl1kfObOnonF/FUKqdtTUFiHlq18xO/RitZ7CThjYUXnMXokwUg/AOT1+PhTMiljGUyTgh9NMyw26nBYC/6QQdHs8vk33eK1EHLRGCVm3d5tWAqUK+k+oVOGKu4jewghkdkp3W4HMAtGLa2g06I/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JXXDN2sidmKop24wFKXERRx9qhLL1bz6vAwVuAPqdV5pGEA93H4b9gyyuEq4IienxiX69RI/PuBk61LVE49pXBCYJ9gEG/1+AM/bcSNs8W4rWote0Nw8ermmcHnwlC8JGwN/fl0ZDSqIwIN8CCyc1OfP8Kr02zlSoRG+aqJvsZ2Rk0kL/8vSmyPEvX1fWOhMmx3VkNuWBBYUWitWrG23FAGwncGFJeV3Bzmw842b45xrKcVAgyrrtqsT2IMvT32OMY0lUmKI91+cNsDNgnEKqKa99z0g2LogTJeMU6GmuNtVLQTRH7hNj6AKxumJFRnwgJzdhVch1KoePKC+ASvH0w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 03 Jun 2022 13:20:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.04.2022 15:21, Roger Pau Monne wrote:
> Allow disabling (masking) IO-APIC pins set to edge trigger mode.  This
> is required in order to safely migrate such interrupts between CPUs,
> as the write to update the IO-APIC RTE (or the IRTE) is not done
> atomically,

For IRTE on VT-d we use cmpxchg16b if available (i.e. virtually always).

> so there's a window where there's a mismatch between the
> destination CPU and the vector:
> 
> (XEN) CPU1: No irq handler for vector b5 (IRQ -11, LAPIC)
> (XEN) IRQ10 a=0002[0002,0008] v=bd[b5] t=IO-APIC-edge s=00000030

I think this needs some further explanation, as we generally move
edge IRQs only when an un-acked interrupt is in flight (and hence
no further one can arrive).

Jan

> The main risk with masking edge triggered interrupts is losing them,
> but getting them injected while in the process of updating the RTE is
> equally harmful as the interrupts gets lost anyway.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
>  xen/arch/x86/io_apic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
> index c086f40f63..2e5964640b 100644
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -1782,7 +1782,7 @@ static hw_irq_controller ioapic_edge_type = {
>      .startup         = startup_edge_ioapic_irq,
>      .shutdown        = irq_shutdown_none,
>      .enable  = unmask_IO_APIC_irq,
> -    .disable         = irq_disable_none,
> +    .disable         = mask_IO_APIC_irq,
>      .ack             = ack_edge_ioapic_irq,
>      .set_affinity    = set_ioapic_affinity_irq,
>  };




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.