KVM: selftests: Add helpers for safe and safe+forced RDMSR, RDPMC, and XGETBV
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:48 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:29:45 +0000 (15:29 -0800)
commitb5e66df34cb0de716859595ce7a4d9d1d015a695
tree303e146b238ab7f4f097fc9d5bc0b070b79f6e7a
parentab3b6a7de8df00b380fb66a523c79e3b387aa877
KVM: selftests: Add helpers for safe and safe+forced RDMSR, RDPMC, and XGETBV

Add helpers for safe and safe-with-forced-emulations versions of RDMSR,
RDPMC, and XGETBV.  Use macro shenanigans to eliminate the rather large
amount of boilerplate needed to get values in and out of registers.

Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20240109230250.424295-29-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/x86_64/processor.h