[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXogtqrZMehORg2L@google.com>
Date: Wed, 28 Jan 2026 06:44:06 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: David Woodhouse <dwmw2@...radead.org>
Cc: Khushit Shah <khushit.shah@...anix.com>, pbonzini@...hat.com, kai.huang@...el.com,
mingo@...hat.com, x86@...nel.org, bp@...en8.de, hpa@...or.com,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
dave.hansen@...ux.intel.com, tglx@...utronix.de, jon@...anix.com,
shaju.abraham@...anix.com, stable@...r.kernel.org
Subject: Re: [PATCH v6] KVM: x86: Add x2APIC "features" to control EOI
broadcast suppression
On Tue, Jan 27, 2026, David Woodhouse wrote:
> On Tue, 2026-01-27 at 13:49 -0800, Sean Christopherson wrote:
> >
> > Nope, we should be good on that front, kvm->arch.irqchip_mode can't be changed
> > once its set. I.e. the irqchip_split() check could get a false negative if it's
> > racing with KVM_CREATE_IRQCHIP, but it can't get a false positive and thus
> > incorrectly allow KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST.
>
> Ah, so userspace which checks all the kernel's capabilities *first*
> will not see KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST advertised,
> because it needs to enable KVM_CAP_SPLIT_IRQCHIP first?
Only if userspace creates a VM and uses that to check capabilities, in which case
KVM is 100% right to say that KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST isn't
supported. If userspace checks the system-scoped ioctl, i.e. with @kvm=NULL, it
will see KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST.
> I guess that's tolerable¹ but the documentation could make it clearer,
> perhaps? I can see VMMs silently failing to detect the feature because
> they just don't set split-irqchip before checking for it?
Hmm, if we want to improve that particular documentation, then we should do so
in the description of KVM_CHECK_EXTENSION itself, which currently says:
Based on their initialization different VMs may have different capabilities.
It is thus encouraged to use the vm ioctl to query for capabilities (available
with KVM_CAP_CHECK_EXTENSION_VM on the vm fd)
Because there multiple capabilities that are conditionally supported based on
the VM type/configuration, i.e. this behavior isn't novel.
> ¹ although I still kind of hate it and would have preferred to have the
> I/O APIC patch; userspace still has to intentionally *enable* that
> combination. But OK, I've reluctantly conceded that.
Eh, VM really should be returning '0' for the check for all KVM_CAP_X2APIC_API,
and disallowing the capability, if the VM doesn't have an in-kernel local APIC.
Because enabling any of the KVM_X2APIC_API_* options without a local APIC doesn't
actually do anything.
I say that because I'd be very tempted to "fix" that by restricting new flags to
VMs with irqchip_in_kernel(), at which point userspace needs to get the ordering
right anyways.
Powered by blists - more mailing lists