Skip to content

Commit

Permalink
KVM: selftests: Use vcpu_clear_cpuid_feature() in monitor_mwait_test
Browse files Browse the repository at this point in the history
Use vcpu_clear_cpuid_feature() to the MONITOR/MWAIT CPUID feature bit in
the MONITOR/MWAIT quirk test.

Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
sean-jc committed Jul 14, 2022
1 parent 1940af0 commit b78843b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tools/testing/selftests/kvm/x86_64/monitor_mwait_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ static void guest_code(void)
int main(int argc, char *argv[])
{
uint64_t disabled_quirks;
struct kvm_cpuid2 *cpuid;
struct kvm_cpuid_entry2 *entry;
struct kvm_vcpu *vcpu;
struct kvm_run *run;
struct kvm_vm *vm;
Expand All @@ -73,14 +71,8 @@ int main(int argc, char *argv[])

TEST_REQUIRE(kvm_has_cap(KVM_CAP_DISABLE_QUIRKS2));

cpuid = kvm_get_supported_cpuid();

entry = kvm_get_supported_cpuid_index(1, 0);
entry->ecx &= ~CPUID_MWAIT;
set_cpuid(cpuid, entry);

vm = vm_create_with_one_vcpu(&vcpu, guest_code);
vcpu_set_cpuid(vcpu);
vcpu_clear_cpuid_feature(vcpu, X86_FEATURE_MWAIT);

run = vcpu->run;

Expand Down

0 comments on commit b78843b

Please sign in to comment.