mbox series

[kvm-unit-tests,0/2] x86: nSVM: Fix a bug with nNPT+x2AVIC

Message ID 20250304211223.124321-1-seanjc@google.com (mailing list archive)
Headers show
Series x86: nSVM: Fix a bug with nNPT+x2AVIC | expand

Message

Sean Christopherson March 4, 2025, 9:12 p.m. UTC
Fix a bug in the nNPT passthrough APIC (MMIO) test where it runs with
x2APIC enabled.  The test currently passes because KVM provides consistent
behavior when the APIC is accessed via MMIO in x2APIC mode (see
KVM_X86_QUIRK_LAPIC_MMIO_HOLE), and because it runs with an in-kernel PIT,
which inhibits x2AVIC.

But with a split IRQCHIP, i.e. no preconfigured PIT, x2AVIC gets enabled
and the test fails because hardware doesn't provide the exact same behavior
as KVM (returns 0s instead of FFs).

Sean Christopherson (2):
  x86: apic: Move helpers for querying APIC state to library code
  x86: nSVM: Ensure APIC MMIO tests run with APIC in xAPIC mode

 lib/x86/apic.h | 21 +++++++++++++++++++++
 x86/apic.c     | 20 --------------------
 x86/svm_npt.c  | 27 +++++++++++++++++++++++++++
 3 files changed, 48 insertions(+), 20 deletions(-)


base-commit: 68fee697b589b7eb7b82e8dd60155c5ccf054275