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@xxxxxxxxxx Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx> --- 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