All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Community Manager <community.manager@xenproject.org>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Matthew Barnes <matthew.barnes@cloud.com>
Subject: Re: [PATCH] x86/APIC: Remove x2APIC pure cluster mode
Date: Wed, 25 Sep 2024 09:59:50 +0200	[thread overview]
Message-ID: <ZvPC9tnqA6ui3YWb@macbook.local> (raw)
In-Reply-To: <22a3542c-7eb4-41fe-8c60-d9a71bd9fa4f@citrix.com>

On Tue, Sep 24, 2024 at 07:20:44PM +0100, Andrew Cooper wrote:
> On 24/09/2024 6:10 pm, Roger Pau Monné wrote:
> > On Tue, Sep 24, 2024 at 06:21:47PM +0200, Jan Beulich wrote:
> >> On 24.09.2024 18:14, Roger Pau Monné wrote:
> >>> On Tue, Sep 24, 2024 at 04:27:36PM +0100, Andrew Cooper wrote:
> >>>> On 24/09/2024 4:10 pm, Roger Pau Monné wrote:
> >>>>> On Mon, Sep 23, 2024 at 03:35:59PM +0100, Matthew Barnes wrote:
> >>>>>> With the introduction of mixed x2APIC mode (using cluster addressing for
> >>>>>> IPIs and physical for external interrupts) the use of pure cluster mode
> >>>>>> doesn't have any benefit.
> >>>>>>
> >>>>>> Remove the mode itself, leaving only the code required for logical
> >>>>>> addressing when sending IPIs.
> >>>>>>
> >>>>>> Implements: https://gitlab.com/xen-project/xen/-/issues/189
> >>>> We use the Resolves: tag for this.  Can fix on commit.
> >>>>
> >>>>> There's at least one extra bit which I would also like to see removed,
> >>>>> either in this patch, or as following patch.
> >>>>>
> >>>>> In struct arch_irq_desc we have 3 cpumasks: cpu_mask, old_cpu_mask and
> >>>>> pending_mask.  After dropping cluster mode for external interrupts,
> >>>>> those fields could become integers AFACT, as now interrupts can only
> >>>>> target a single CPU opposed to a logical CPU set.
> >>>> A separate patch for sure, but that sounds like a great improvement.
> >>> Oh, there are quite some fields of struct genapic that are not needed
> >>> anymore, since both implementations set it to the same function.  It
> >>> would be helpful to prune them.
> >> Pruning where possible - yes. But "both" won't cover it, as we have 4
> >> instances of the struct (not just the two x2apic ones).
> > Yeah, realized that afterwards, we still have the xAPIC flat mode,
> > which is using logical delivery mode, but target a single CPU.  So
> > getting rid of the cpumask in arch_irq_desc seem possible, however
> > there might be nothing to prune in struct genapic.
> 
> Logical delivery mode for external interrupts in xAPIC is just as
> broken/useless as the code we've just deleted.
> 
> If that's the only thing in the way of more cleanup, we delete it too.

Bah, xAPIC flat delivery mode needs to be adjusted to use physical
delivery for external interrupts, as the vector space is shared
between all CPUs in that mode.  This must be done ahead of turning the
arch_irq_desc cpumasks into integers.

Sorry, this is turning into a more work that I originally expected,
mostly because I wasn't taking into account that xAPIC was still using
logical mode for external interrupts.

Thanks, Roger.


  reply	other threads:[~2024-09-25  8:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23 14:35 [PATCH] x86/APIC: Remove x2APIC pure cluster mode Matthew Barnes
2024-09-24 14:51 ` Jan Beulich
2024-09-24 15:00 ` oleksii.kurochko
2024-09-24 15:10 ` Roger Pau Monné
2024-09-24 15:27   ` Andrew Cooper
2024-09-24 16:14     ` Roger Pau Monné
2024-09-24 16:21       ` Jan Beulich
2024-09-24 17:10         ` Roger Pau Monné
2024-09-24 18:20           ` Andrew Cooper
2024-09-25  7:59             ` Roger Pau Monné [this message]
2024-09-24 15:27   ` Jan Beulich
2024-09-24 15:30 ` Andrew Cooper

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=ZvPC9tnqA6ui3YWb@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=community.manager@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=matthew.barnes@cloud.com \
    --cc=oleksii.kurochko@gmail.com \
    --cc=sstabellini@kernel.org \
    --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.