KVM:selftests: Add selftests for CET MSRs
RFC PATCH 1/1 KVM:selftests: Add selftests for CET MSRs
Test all CET related MSRs with both valid and invalid values in different guest CET support modes. The intent is to test whether any fault/invalid values escape KVM's check or not.
The test doesn't cover all possible valid or invalid msr values but select at least one case of each categories to accelerate tests.
AMD platform support will be added after MSR test framework is fixed.
Signed-off-by Yang Weijiang <[email protected]>
--- tools/arch/x86/include/asm/msr-index.h | 2 +- tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/x86_64/cet_msrs_test.c | 369 ++++++++++++++++++ 3 files changed, 371 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/kvm/x86_64/cet_msrs_test.c
tools/arch/x86/include/asm/msr-index.h +1 -1
@@ -438,7 +438,7 @@#define CET_LEG_IW_EN BIT_ULL(3)#define CET_NO_TRACK_EN BIT_ULL(4)#define CET_SUPPRESS_DISABLE BIT_ULL(5) -#define CET_RESERVED (BIT_ULL(6) | BIT_ULL(7) | BIT_ULL(8) | BIT_ULL(9)) +#define CET_INTEL_RESERVED GENMASK_ULL(9, 6)#define CET_SUPPRESS BIT_ULL(10)#define CET_WAIT_ENDBR BIT_ULL(11)
tools/testing/selftests/kvm/Makefile +1 -0
@@ -117,6 +117,7 @@ TEST_GEN_PROGS_x86_64 += x86_64/sev_migrate_tests TEST_GEN_PROGS_x86_64 += x86_64/amx_test TEST_GEN_PROGS_x86_64 += x86_64/max_vcpuid_cap_test TEST_GEN_PROGS_x86_64 += x86_64/triple_fault_event_test +TEST_GEN_PROGS_x86_64 += x86_64/cet_msrs_test TEST_GEN_PROGS_x86_64 += access_tracking_perf_test TEST_GEN_PROGS_x86_64 += demand_paging_test TEST_GEN_PROGS_x86_64 += dirty_log_test
tools/testing/selftests/kvm/x86_64/cet_msrs_test.c new file +369 -0
369 lines not on this page · raw message
Signature · 1 line
2.27.0