KVM: selftests: Test behavior of HWCR, a.k.a. MSR_K7_HWCR
authorJim Mattson <jmattson@google.com>
Fri, 29 Sep 2023 23:02:46 +0000 (16:02 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 9 Oct 2023 19:37:45 +0000 (12:37 -0700)
commit591455325a79dbe3be429006f8156f727b2a52dd
tree97735ebcf001c1a52c382af283ff22109284994f
parent8b0e00fba93449ecdda2c641e90c9b1f25f46669
KVM: selftests: Test behavior of HWCR, a.k.a. MSR_K7_HWCR

Verify the following behavior holds true for writes and reads of HWCR from
host userspace:

* Attempts to set bits 3, 6, or 8 are ignored
* Bits 18 and 24 are the only bits that can be set
* Any bit that can be set can also be cleared

Signed-off-by: Jim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20230929230246.1954854-4-jmattson@google.com
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c [new file with mode: 0644]