[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6353f43f3493b436064068e6a7f55543a2cd7ae1.camel@infradead.org>
Date: Tue, 02 Dec 2025 09:13:32 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Khushit Shah <khushit.shah@...anix.com>, seanjc@...gle.com,
pbonzini@...hat.com, kai.huang@...el.com
Cc: 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 v3] KVM: x86: Add x2APIC "features" to control EOI
broadcast suppression
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.
> 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?
> +Setting KVM_X2APIC_API_DISABLE_SUPPRESS_EOI_BROADCAST disables support for
> +Suppress EOI Broadcasts entirely, i.e. instructs KVM to NOT advertise support
> +to the guest and thus disallow enabling EOI broadcast suppression in SPIV.
Could we perhaps call them 'ENABLE_SUPPRESS_EOI_BROADCAST' and
'DISABLE_SUPPRESS_EOI_BROADCAST', with a note saying that modern VMMs
should always explicitly enable one or the other, because for
historical reasons KVM only *pretends* to support it by default but it
doesn't actually work correctly?
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5069 bytes)
Powered by blists - more mailing lists