From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Khushit Shah <khushit.shah@nutanix.com>,
pbonzini@redhat.com, kai.huang@intel.com, mingo@redhat.com,
x86@kernel.org, bp@alien8.de, hpa@zytor.com,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
dave.hansen@linux.intel.com, tglx@linutronix.de,
jon@nutanix.com, shaju.abraham@nutanix.com,
stable@vger.kernel.org
Subject: Re: [PATCH v6] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression
Date: Wed, 28 Jan 2026 06:44:06 -0800 [thread overview]
Message-ID: <aXogtqrZMehORg2L@google.com> (raw)
In-Reply-To: <ea294969d05fc9c37e72053d7343e11fa9ffdded.camel@infradead.org>
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.
next prev parent reply other threads:[~2026-01-28 14:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 12:56 [PATCH v6] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression Khushit Shah
2026-01-27 2:21 ` Khushit Shah
2026-01-27 2:41 ` Khushit Shah
2026-01-27 21:09 ` David Woodhouse
2026-01-27 21:49 ` Sean Christopherson
2026-01-27 22:36 ` David Woodhouse
2026-01-28 2:22 ` Huang, Kai
2026-01-28 3:48 ` David Woodhouse
[not found] ` <SA2PR02MB756478359EE9185285ACE6158891A@SA2PR02MB7564.namprd02.prod.outlook.com>
2026-01-28 5:17 ` Khushit Shah
2026-01-28 5:32 ` David Woodhouse
2026-01-28 6:40 ` Huang, Kai
2026-01-28 15:04 ` Sean Christopherson
2026-01-28 6:15 ` Huang, Kai
2026-01-28 14:57 ` Sean Christopherson
2026-01-28 21:10 ` Huang, Kai
2026-01-28 14:44 ` Sean Christopherson [this message]
2026-02-04 0:10 ` Sean Christopherson
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=aXogtqrZMehORg2L@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=hpa@zytor.com \
--cc=jon@nutanix.com \
--cc=kai.huang@intel.com \
--cc=khushit.shah@nutanix.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=shaju.abraham@nutanix.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox