From b793bd65cd9eb9416b0181f93c31a862fc38ffff Mon Sep 17 00:00:00 2001 From: Egor Lazarchuk Date: Fri, 18 Jul 2025 10:52:04 +0100 Subject: [PATCH 1/2] fix: update AMD host cpu features checks Nested virtualization is now disabled and some cpu features/MSRs now should be marked as host only. These cpu features/MSRs are described the AMD reference manual at "SVM Revision and Feature Identification" section. Signed-off-by: Egor Lazarchuk --- .../functional/test_cpu_features_host_vs_guest.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/integration_tests/functional/test_cpu_features_host_vs_guest.py b/tests/integration_tests/functional/test_cpu_features_host_vs_guest.py index 4b66b077839..955a70bd38b 100644 --- a/tests/integration_tests/functional/test_cpu_features_host_vs_guest.py +++ b/tests/integration_tests/functional/test_cpu_features_host_vs_guest.py @@ -120,6 +120,9 @@ "vgif", "vmcb_clean", "wdt", + "npt", + "nrip_save", + "svm", } AMD_GUEST_ONLY_FEATS = { @@ -130,14 +133,7 @@ } AMD_MILAN_HOST_ONLY_FEATS_6_1 = AMD_MILAN_HOST_ONLY_FEATS - { - "lbrv", - "pausefilter", - "pfthreshold", "sme", - "tsc_scale", - "v_vmsave_vmload", - "vgif", - "vmcb_clean", } | {"brs", "rapl", "v_spec_ctrl"} AMD_GENOA_HOST_ONLY_FEATS = AMD_MILAN_HOST_ONLY_FEATS | { From 568cf023db615737c9b92db21c0015df6a1a1c39 Mon Sep 17 00:00:00 2001 From: Egor Lazarchuk Date: Fri, 18 Jul 2025 12:23:50 +0100 Subject: [PATCH 2/2] fix: add MSR_TSC_RATE to the MSR_EXCEPTION_LIST Now this MSR is host only and not available in the guest. Check AMD reference manual at "SVM Revision and Feature Identification" section for more information. Signed-off-by: Egor Lazarchuk --- .../functional/test_cpu_template_helper.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests/functional/test_cpu_template_helper.py b/tests/integration_tests/functional/test_cpu_template_helper.py index 6ff2db1f7f0..e4c087fa497 100644 --- a/tests/integration_tests/functional/test_cpu_template_helper.py +++ b/tests/integration_tests/functional/test_cpu_template_helper.py @@ -177,7 +177,8 @@ def build_cpu_config_dict(cpu_config_path): } -# List of MSR indices that should not be tested due to its mutability. +# List of MSR indices that should not be tested due to its mutability or inavailablility +# in the guest. MSR_EXCEPTION_LIST = [ # MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME depend on the elapsed time. 0x11, @@ -232,6 +233,10 @@ def build_cpu_config_dict(cpu_config_path): # MSR_AMD64_VIRT_SPEC_CTRL is R/W and can be modified by OS to control # security features for speculative attacks. 0xC001011F, + # Not available in the guest + # MSR_TSC_RATE is a Time Stamp Counter Ratio which allows the hypervisor + # to control the guest's view of the Time Stamp Counter. + 0xC0000104, ]