MSR_IA32_TSC_ADJUST may be supported by KVM on AMD machines, but it does not show on AMD manual. Check CPUID to see if it supported before running the relevant tests. Signed-off-by: Nadav Amit <namit@xxxxxxxxxx> --- x86/svm_tests.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/x86/svm_tests.c b/x86/svm_tests.c index a2c993d..92cefaf 100644 --- a/x86/svm_tests.c +++ b/x86/svm_tests.c @@ -893,6 +893,11 @@ static bool npt_rw_l1mmio_check(struct svm_test *test) #define TSC_OFFSET_VALUE (~0ull << 48) static bool ok; +static bool tsc_adjust_supported(void) +{ + return this_cpu_has(X86_FEATURE_TSC_ADJUST); +} + static void tsc_adjust_prepare(struct svm_test *test) { default_prepare(test); @@ -2010,7 +2015,7 @@ struct svm_test svm_tests[] = { { "npt_rw_l1mmio", npt_supported, npt_rw_l1mmio_prepare, default_prepare_gif_clear, npt_rw_l1mmio_test, default_finished, npt_rw_l1mmio_check }, - { "tsc_adjust", default_supported, tsc_adjust_prepare, + { "tsc_adjust", tsc_adjust_supported, tsc_adjust_prepare, default_prepare_gif_clear, tsc_adjust_test, default_finished, tsc_adjust_check }, { "latency_run_exit", default_supported, latency_prepare, -- 2.25.1