public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] KVM: x86: Add userspace control for Suppress EOI Broadcast
@ 2025-12-29 11:17 Khushit Shah
  2025-12-29 11:17 ` [PATCH v5 1/3] KVM: x86: Refactor suppress EOI broadcast logic Khushit Shah
                   ` (3 more replies)
  0 siblings, 4 replies; 28+ messages in thread
From: Khushit Shah @ 2025-12-29 11:17 UTC (permalink / raw)
  To: seanjc, pbonzini, kai.huang, dwmw2
  Cc: mingo, x86, bp, hpa, linux-kernel, kvm, dave.hansen, tglx, jon,
	shaju.abraham, Khushit Shah

Suppress EOI Broadcast (SEOIB) is an x2APIC feature that stops the local
APIC from broadcasting EOIs to I/O APICs.  When enabled, guests must
directly write to specific I/O APIC's EOI Register (available in I/O APIC
version 0x20+) to EOI the interrupt.

KVM has historically mishandled SEOIB support.  When x2APIC was introduced,
KVM advertised the feature without implementing the I/O APIC side (directed
EOI).  This flaw carried over to split IRQCHIP mode, where KVM always
advertised support but didn't actually honor the guest's decision to
suppress EOI broadcast, and kept broadcasting EOIs to userspace.

The broken behavior can cause interrupt storms on guests that perform I/O
APIC EOI well after LAPIC EOI (e.g. Windows with Credential Guard enabled).

KVM "fixed" in-kernel IRQCHIP by not advertising SEOIB support, but
split IRQCHIP was never fixed.  Rather than silently changing guest-visible
behavior, this series adds userspace control via KVM_CAP_X2APIC_API flags,
allowing VMMs to explicitly enable or disable SEOIB support.  When enabled
with in-kernel IRQCHIP, KVM uses I/O APIC version 0x20 which provides the
EOI Register for directed EOI.

The series maintains backward compatibility: if neither flag is set,
legacy behavior is preserved.  Modern VMMs should explicitly set either
KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST or
KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST.

Tested:
- No flags set: legacy quirky behavior preserved.
- ENABLE flag set: SEOIB advertised, in-kernel IRQCHIP uses I/O APIC
  version 0x20.
- DISABLE flag set: SEOIB not advertised.

Changes in v5:
- Split into 3-patch series (refactor, I/O APIC 0x20 support, userspace
  control)
- Extended to support in-kernel IRQCHIP mode.
- I/O APIC version 0x20 is used when enabling with in-kernel IRQCHIP

David Woodhouse (1):
  KVM: x86/ioapic: Implement support for I/O APIC version 0x20 with EOIR

Khushit Shah (2):
  KVM: x86: Refactor suppress EOI broadcast logic
  KVM: x86: Add x2APIC "features" to control EOI broadcast suppression

 Documentation/virt/kvm/api.rst  | 28 +++++++++++-
 arch/x86/include/asm/kvm_host.h |  7 +++
 arch/x86/include/uapi/asm/kvm.h |  6 ++-
 arch/x86/kvm/ioapic.c           | 43 ++++++++++++++++---
 arch/x86/kvm/ioapic.h           | 19 +++++----
 arch/x86/kvm/lapic.c            | 75 +++++++++++++++++++++++++++++----
 arch/x86/kvm/lapic.h            |  3 ++
 arch/x86/kvm/trace.h            | 17 ++++++++
 arch/x86/kvm/x86.c              | 15 ++++++-
 9 files changed, 186 insertions(+), 27 deletions(-)

-- 
2.39.3


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2026-02-04  0:00 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-29 11:17 [PATCH v5 0/3] KVM: x86: Add userspace control for Suppress EOI Broadcast Khushit Shah
2025-12-29 11:17 ` [PATCH v5 1/3] KVM: x86: Refactor suppress EOI broadcast logic Khushit Shah
2026-01-02 16:23   ` David Woodhouse
2026-01-12  4:15     ` Khushit Shah
2026-01-13 23:40       ` David Woodhouse
2026-01-14  0:10       ` Sean Christopherson
2026-01-16  4:41         ` Khushit Shah
2026-01-16  9:01         ` David Woodhouse
2026-01-16 10:02           ` Khushit Shah
2026-01-16 17:34             ` Sean Christopherson
2026-01-23 13:04               ` Khushit Shah
2026-01-13 23:11   ` Sean Christopherson
2025-12-29 11:17 ` [PATCH v5 2/3] KVM: x86/ioapic: Implement support for I/O APIC version 0x20 with EOIR Khushit Shah
2025-12-29 11:39   ` David Woodhouse
2025-12-29 12:21     ` Khushit Shah
2025-12-29 13:01       ` David Woodhouse
2025-12-29 15:16         ` Khushit Shah
2025-12-29 15:36           ` David Woodhouse
2025-12-29 15:57             ` Khushit Shah
2026-01-02 16:17               ` David Woodhouse
2026-01-12  3:22                 ` Khushit Shah
2025-12-29 11:17 ` [PATCH v5 3/3] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression Khushit Shah
2026-01-02 16:41   ` David Woodhouse
2026-01-12  3:27     ` Khushit Shah
2026-01-29  4:49 ` [PATCH v5 4/3] KVM: selftests: Add test cases for EOI suppression modes David Woodhouse
2026-01-29 15:19   ` Sean Christopherson
2026-01-29 15:58     ` David Woodhouse
2026-02-04  0:00       ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox