All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 06/12] x86/i8259: redo workaround for AMD spurious PIC interrupts
Date: Fri, 21 Nov 2025 09:35:16 +0100	[thread overview]
Message-ID: <aSAkROL4OqcZ8AAX@Mac.lan> (raw)
In-Reply-To: <126dc8bb-4f89-4a40-b39a-1b09d78b3eac@suse.com>

On Thu, Nov 20, 2025 at 04:05:38PM +0100, Jan Beulich wrote:
> On 20.11.2025 10:58, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/i8259.c
> > +++ b/xen/arch/x86/i8259.c
> > @@ -407,21 +407,14 @@ void __init init_IRQ(void)
> >          per_cpu(vector_irq, cpu)[LEGACY_VECTOR(irq)] = irq;
> >  
> >          /*
> > -         * The interrupt affinity logic never targets interrupts to offline
> > -         * CPUs, hence it's safe to use cpumask_all here.
> > -         *
> >           * Legacy PIC interrupts are only targeted to CPU0, but depending on
> >           * the platform they can be distributed to any online CPU in hardware.
> > -         * Note this behavior has only been observed on AMD hardware. In order
> > -         * to cope install all active legacy vectors on all CPUs.
> > -         *
> > -         * IO-APIC will change the destination mask if/when taking ownership of
> > -         * the interrupt.
> > +         * Note this behavior has only been observed on AMD hardware. Set the
> > +         * target CPU as expected here, and cope with the possibly spurious
> > +         * interrupts in do_IRQ().  This behavior has only been observed
> > +         * during AP bringup.
> >           */
> > -        cpumask_copy(desc->arch.cpu_mask,
> > -                     (boot_cpu_data.x86_vendor &
> > -                      (X86_VENDOR_AMD | X86_VENDOR_HYGON) ? &cpumask_all
> > -                                                          : cpumask_of(cpu)));
> > +        cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
> >          desc->arch.vector = LEGACY_VECTOR(irq);
> >      }
> 
> Doesn't this collide with what setup_vector_irq() does (see also patch 04)? If
> you don't set all bits here, not all CPUs will have the vector_irq[] slot set
> correctly for do_IRQ() to actually be able to associate the vector with the
> right IRQ.

For the AMD workaround I've only ever saw the spurious vector
triggering on CPUs different than the BSP at bringup, I don't think we
strictly need to bind all legacy vectors on all possible CPUs.  Well
behaved PIC interrupts will only target the BSP, and that's properly
setup.

Thanks, Roger.


  reply	other threads:[~2025-11-21  8:35 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20  9:06 [PATCH 00/12] x86/irq: drop interrupt target cpumasks Roger Pau Monne
2025-11-20  9:06 ` [PATCH 01/12] x86/apic: remove cpu_mask_to_apicid hook Roger Pau Monne
2025-11-20 12:19   ` Jan Beulich
2025-11-20 12:25   ` Andrew Cooper
2025-11-20  9:06 ` [PATCH 02/12] x86/apic: remove vector_allocation_cpumask hook Roger Pau Monne
2025-11-20 12:25   ` Jan Beulich
2025-11-20 12:30   ` Andrew Cooper
2025-11-20  9:06 ` [PATCH 03/12] x86/irq: introduce local irq_desc Roger Pau Monne
2025-11-20 12:39   ` Andrew Cooper
2025-11-20  9:06 ` [PATCH 04/12] x86/irq: set accurate cpu_mask for high priority vectors used by external interrupts Roger Pau Monne
2025-11-20 12:45   ` Andrew Cooper
2025-11-20 12:53     ` Jan Beulich
2025-11-20 13:06   ` Jan Beulich
2025-11-21  8:29     ` Roger Pau Monné
2025-11-24 10:16       ` Jan Beulich
2025-11-20  9:06 ` [PATCH 05/12] x86/io-apic: purge usage of logical mode Roger Pau Monne
2025-11-20 13:18   ` Andrew Cooper
2025-11-20 14:27     ` Jan Beulich
2025-11-20 18:30       ` Andrew Cooper
2025-11-21  7:38         ` Jan Beulich
2025-11-20  9:58 ` [PATCH 06/12] x86/i8259: redo workaround for AMD spurious PIC interrupts Roger Pau Monne
2025-11-20  9:58   ` [PATCH 07/12] x86/io-apic: fix usage of setup_ioapic_dest() Roger Pau Monne
2025-11-20 16:02     ` Jan Beulich
2025-11-20  9:58   ` [PATCH 08/12] x86/irq: adjust bind_irq_vector() to take a single CPU as parameter Roger Pau Monne
2025-11-24 10:52     ` Jan Beulich
2025-11-20  9:58   ` [PATCH 09/12] x86/irq: convert cpumask parameter to integer in {,p}irq_set_affinity() Roger Pau Monne
2025-11-24 11:20     ` Jan Beulich
2025-11-20  9:58   ` [PATCH 10/12] x86/irq: convert irq_desc cpu_mask field to integer Roger Pau Monne
2025-11-24 12:01     ` Jan Beulich
2025-11-20  9:58   ` [PATCH 11/12] x86/irq: convert irq_desc old_cpu_mask " Roger Pau Monne
2025-11-24 12:54     ` Jan Beulich
2025-11-20  9:58   ` [PATCH 12/12] x86/irq: convert irq_desc pending_mask " Roger Pau Monne
2025-11-24 12:57     ` Jan Beulich
2025-11-20 15:05   ` [PATCH 06/12] x86/i8259: redo workaround for AMD spurious PIC interrupts Jan Beulich
2025-11-21  8:35     ` Roger Pau Monné [this message]
2025-11-24 10:20       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSAkROL4OqcZ8AAX@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.