All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] x86: apic: Add test config to allow running apic tests against SVM's AVIC
@ 2022-02-04 21:44 Sean Christopherson
  0 siblings, 0 replies; only message in thread
From: Sean Christopherson @ 2022-02-04 21:44 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kvm, Sean Christopherson

Add a curated "xapic" test configuration that hides x2APIC from the guest
and does not expose a PIT/8254 timer to the guest so that KVM won't
disable AVIC due to incompatibilities.

Caveat emptor: actually running the test with AVIC enabled will fail
miserably.  KVM botches xAPIC ID changes[*], and then fails for reasons
unknown after fixing the ID goof in the "write everything" case:

  memset((void *)APIC_DEFAULT_PHYS_BASE, 0xff, PAGE_SIZE);

But, AVIC is off by default and requires disabling nested support, i.e.
only people doing actual AVIC work will be affected because it's highly
unlikely to be enabled by accident.

[*] https://lore.kernel.org/all/d058f7464084cadc183bd9dbf02c7f525bb9f902.camel@redhat.com

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 x86/unittests.cfg | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 9a70ba3b..f46fb715 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -30,18 +30,31 @@ file = apic.flat
 smp = 2
 extra_params = -cpu qemu64,+x2apic,+tsc-deadline -machine kernel_irqchip=split
 arch = x86_64
+groups = apic
 
 [ioapic-split]
 file = ioapic.flat
 extra_params = -cpu qemu64 -machine kernel_irqchip=split
 arch = x86_64
+groups = apic
 
-[apic]
+[x2apic]
 file = apic.flat
 smp = 2
 extra_params = -cpu qemu64,+x2apic,+tsc-deadline
 arch = x86_64
 timeout = 30
+groups = apic
+
+# Hide x2APIC and don't create a Programmable Interval Timer (PIT, a.k.a 8254)
+# to allow testing SVM's AVIC, which is disabled if either is exposed to the guest.
+[xapic]
+file = apic.flat
+smp = 2
+extra_params = -cpu qemu64,-x2apic,+tsc-deadline -machine pit=off
+arch = x86_64
+timeout = 30
+groups = apic
 
 [ioapic]
 file = ioapic.flat

base-commit: dbf4a3c3b469a2d92366a58f481d13c98a78eecc
-- 
2.35.0.263.gb82422642f-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-04 21:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 21:44 [kvm-unit-tests PATCH] x86: apic: Add test config to allow running apic tests against SVM's AVIC Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.