OSDN Git Service

KVM: selftests: Add MONITOR/MWAIT quirk test
authorSean Christopherson <seanjc@google.com>
Wed, 8 Jun 2022 22:45:16 +0000 (22:45 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Jun 2022 19:14:20 +0000 (15:14 -0400)
commit2325d4dd7321cd569f996c5d091f4f83efb25693
treeff5dd64034e312823d466ac090a49540f8ce8c82
parentcc5851c6be864c5772944e32df3da322fe3ad415
KVM: selftests: Add MONITOR/MWAIT quirk test

Add a test to verify the "MONITOR/MWAIT never fault" quirk, and as a
bonus, also verify the related "MISC_ENABLES ignores ENABLE_MWAIT" quirk.

If the "never fault" quirk is enabled, MONITOR/MWAIT should always be
emulated as NOPs, even if they're reported as disabled in guest CPUID.
Use the MISC_ENABLES quirk to coerce KVM into toggling the MWAIT CPUID
enable, as KVM now disallows manually toggling CPUID bits after running
the vCPU.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220608224516.3788274-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/x86_64/monitor_mwait_test [deleted file]
tools/testing/selftests/kvm/x86_64/monitor_mwait_test.c [new file with mode: 0644]