]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Verify supported CR4 bits can be set before KVM_SET_CPUID2
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 7 Oct 2020 01:44:17 +0000 (18:44 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 15 Nov 2020 14:49:08 +0000 (09:49 -0500)
commitbf0935fb7d2cf1f5b074a7a3b4aee3484331cf19
tree191f1cda10949add46169798c22612c724b02f0f
parent7670d3b906ab922808d465025d56354fd3e7c8d3
KVM: selftests: Verify supported CR4 bits can be set before KVM_SET_CPUID2

Extend the KVM_SET_SREGS test to verify that all supported CR4 bits, as
enumerated by KVM, can be set before KVM_SET_CPUID2, i.e. without first
defining the vCPU model.  KVM is supposed to skip guest CPUID checks
when host userspace is stuffing guest state.

Check the inverse as well, i.e. that KVM rejects KVM_SET_REGS if CR4
has one or more unsupported bits set.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20201007014417.29276-7-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/include/x86_64/vmx.h
tools/testing/selftests/kvm/x86_64/set_sregs_test.c