public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Khushit Shah <khushit.shah@nutanix.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Kai Huang <kai.huang@intel.com>,
	 Shaju Abraham <shaju.abraham@nutanix.com>,
	"x86@kernel.org" <x86@kernel.org>,  "bp@alien8.de" <bp@alien8.de>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	 "dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	 "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Jon Kohler <jon@nutanix.com>,
	 "tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [PATCH v6] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression
Date: Wed, 28 Jan 2026 07:04:15 -0800	[thread overview]
Message-ID: <aXolb--54UNUJqU9@google.com> (raw)
In-Reply-To: <DBAD995F-C9E1-46C8-A49A-9D774D6D4612@nutanix.com>

On Wed, Jan 28, 2026, Khushit Shah wrote:
> 
> > On 28 Jan 2026, at 9:27 AM, Khushit Shah <khushit.shah@nutanix.com> wrote:
> > 
> > 
> > On 28/01/26, 9:19 AM, "David Woodhouse" <dwmw2@infradead.org> wrote:
> > 
> > On Wed, 2026-01-28 at 02:22 +0000, Huang, Kai wrote:
> > >  
> > > > 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?
> > > > > > 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? > > > > > > ¹ 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.
> > > > To make it even more robust, perhaps we can grab kvm->lock mutex in
> > > kvm_vm_ioctl_enable_cap() for KVM_CAP_X2APIC_API, so that it won't race with
> > > KVM_CREATE_IRQCHIP (which already grabs kvm->lock) and
> > > KVM_CAP_SPLIT_IRQCHIP?
> > > > Even more, we can add additional check in KVM_CREATE_IRQCHIP to return -
> > > EINVAL when it sees kvm->arch.suppress_eoi_broadcast_mode is
> > > KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST?
> > 
> > If we do that, then the query for KVM_CAP_X2APIC_API could advertise
> > the KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST for a freshly created KVM,
> > even before userspace has enabled *either* KVM_CREATE_IRQCHIP nor
> > KVM_CAP_SPLIT_IRQCHIP?
> > 
> > That would be slightly better than the existing proposed awfulness
> > where the kernel doesn't *admit* to having the _ENABLE_ capability
> > until userspace first enables the KVM_CAP_SPLIT_IRQCHIP.

No.  If userspace wants to see if *KVM* supports the feature, then userspace can
do KVM_CHECK_EXTENSION on /dev/kvm.  If userspace does KVM_CHECK_EXTENSION on a
VM fd, then KVM absolutely must report exactly what that VM supports.

> How about we make an explicit _ENABLE_ bit for split IRQCHIP?
> When/if in-kernel IRQCHIP starts supporting I/O APIC 0x20, we
> can add a separate bit for that in the CAP. 

NAK.  Conditionally enumerating support for a feature based on the configuration
of the VM has been KVM's documented behavior since KVM_CHECK_EXTENSION was added
by commit 92b591a4c46b ("KVM: Allow KVM_CHECK_EXTENSION on the vm fd").

I don't see any reason why KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST needs to do
something different.

  parent reply	other threads:[~2026-01-28 15:04 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 [this message]
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
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=aXolb--54UNUJqU9@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