KVM: selftests: Verify APIC_ID is set when forcing x2APIC=>xAPIC transition
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Mon, 9 Jan 2023 13:06:05 +0000 (08:06 -0500)
committerSean Christopherson <seanjc@google.com>
Thu, 2 Feb 2023 00:22:54 +0000 (16:22 -0800)
commiteb98192576315d3f4c6c990d589ab398e7091782
tree5bd9204ae5a26ad73a80ebf2af3b1f462b4f113c
parent052c3b99cbc8d227f8cb8edf1519197808d1d653
KVM: selftests: Verify APIC_ID is set when forcing x2APIC=>xAPIC transition

Add a sub-test to verify that KVM stuffs the APIC_ID when userspace forces
a transition from x2APIC to xAPIC without first disabling the APIC.  Such
a transition is architecturally disallowed (WRMSR will #GP), but needs to
be handled by KVM to allow userspace to emulate RESET (ignoring that
userspace should also stuff local APIC state on RESET).

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Link: https://lore.kernel.org/r/20230109130605.2013555-3-eesposit@redhat.com
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/xapic_state_test.c