mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Khushit Shah <khushit.shah@nutanix.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: "seanjc@google.com" <seanjc@google.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"kai.huang@intel.com" <kai.huang@intel.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"x86@kernel.org" <x86@kernel.org>, "bp@alien8.de" <bp@alien8.de>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	Jon Kohler <jon@nutanix.com>,
	Shaju Abraham <shaju.abraham@nutanix.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v3] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression
Date: Tue, 2 Dec 2025 12:58:52 +0000	[thread overview]
Message-ID: <A922DCC2-4CB4-4DE8-82FA-95B502B3FCD4@nutanix.com> (raw)
In-Reply-To: <6353f43f3493b436064068e6a7f55543a2cd7ae1.camel@infradead.org>

Thanks for the review!

> On 2 Dec 2025, at 2:43 PM, David Woodhouse <dwmw2@infradead.org> wrote:
> 
> Firstly, excellent work debugging and diagnosing that!
> 
> On Tue, 2025-11-25 at 18:05 +0000, Khushit Shah wrote:
>> 
>> --- a/Documentation/virt/kvm/api.rst
>> +++ b/Documentation/virt/kvm/api.rst
>> @@ -7800,8 +7800,10 @@ Will return -EBUSY if a VCPU has already been created.
>>  
>>  Valid feature flags in args[0] are::
>>  
>> -  #define KVM_X2APIC_API_USE_32BIT_IDS            (1ULL << 0)
>> -  #define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK  (1ULL << 1)
>> +  #define KVM_X2APIC_API_USE_32BIT_IDS                               (1ULL << 0)
>> +  #define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK                     (1ULL << 1)
>> +  #define KVM_X2APIC_API_DISABLE_IGNORE_SUPPRESS_EOI_BROADCAST_QUIRK (1ULL << 2)
>> +  #define KVM_X2APIC_API_DISABLE_SUPPRESS_EOI_BROADCAST              (1ULL << 3)
>> 
> 
> I kind of hate these names. This part right here is what we leave
> behind for future generations, to understand the weird behaviour of
> KVM. To have "IGNORE" "SUPPRESS" "QUIRK" all in the same flag, quite
> apart from the length of the token, makes my brain hurt.

Yes, I agree the original name is too wordy. How about renaming it to
KVM_X2APIC_API_ACTUALLY_SUPPRESS_EOI_BROADCASTS?
That makes the intended KVM behaviour clear.

I'm also not very keen on ENABLE_SUPPRESS_EOI_BROADCAST
it reads as if KVM is the one enabling the feature, which isn't the case.
The guest decides whether to enable suppression; KVM should just
advertise the capability correctly and then respect whatever the guest
chooses.

> On 2 Dec 2025, at 2:43 PM, David Woodhouse <dwmw2@infradead.org> wrote:
> 
>>  Enabling KVM_X2APIC_API_USE_32BIT_IDS changes the behavior of
>>  KVM_SET_GSI_ROUTING, KVM_SIGNAL_MSI, KVM_SET_LAPIC, and KVM_GET_LAPIC,
>> @@ -7814,6 +7816,14 @@ as a broadcast even in x2APIC mode in order to support physical x2APIC
>>  without interrupt remapping.  This is undesirable in logical mode,
>>  where 0xff represents CPUs 0-7 in cluster 0.
>>  
>> +Setting KVM_X2APIC_API_DISABLE_IGNORE_SUPPRESS_EOI_BROADCAST_QUIRK overrides
>> +KVM's quirky behavior of not actually suppressing EOI broadcasts for split IRQ
>> +chips when support for Suppress EOI Broadcasts is advertised to the guest.
> 
> This paragraph doesn't actually say what the flag *does*, only the old
> behaviour that it overrides?

Right, good point. I'll update the doc.

  reply	other threads:[~2025-12-02 12:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 18:05 Khushit Shah
2025-11-25 21:16 ` Huang, Kai
2025-12-02  9:13 ` David Woodhouse
2025-12-02 12:58   ` Khushit Shah [this message]
2025-12-02 13:31     ` David Woodhouse
2025-12-02 15:42       ` Sean Christopherson
2025-12-02 15:51         ` David Woodhouse
2025-12-02 16:36           ` Sean Christopherson
2025-12-02 17:10             ` David Woodhouse
2025-12-02 22:26               ` Sean Christopherson
2025-12-02 22:35                 ` David Woodhouse
2025-12-03  0:50             ` Huang, Kai
2025-12-03  1:14               ` David Woodhouse
2025-12-03 12:25               ` David Woodhouse
2025-12-03 13:10                 ` Paolo Bonzini
2025-12-03 13:32                   ` David Woodhouse
2025-12-03 13:36                     ` Paolo Bonzini
2025-12-03 13:55                       ` David Woodhouse
2025-12-03  7:45             ` Khushit Shah
2025-12-02 16:04         ` David Woodhouse

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=A922DCC2-4CB4-4DE8-82FA-95B502B3FCD4@nutanix.com \
    --to=khushit.shah@nutanix.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=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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

all inboxes | Powered by JetHome®