Skip to content

Commit

Permalink
fix(tests): bring back the AMD Genoa check
Browse files Browse the repository at this point in the history
Fixes: f4f7536

Signed-off-by: Pablo Barbáchano <[email protected]>
  • Loading branch information
pb8o committed Dec 6, 2024
1 parent 7ca8221 commit 7e0aaab
Showing 1 changed file with 57 additions and 46 deletions.
103 changes: 57 additions & 46 deletions tests/integration_tests/functional/test_cpu_features_host_vs_guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,52 @@
"xtpr",
}

AMD_HOST_ONLY_FEATS = {
"amd_ppin",
"aperfmperf",
"bpext",
"cat_l3",
"cdp_l3",
"cpb",
"cqm",
"cqm_llc",
"cqm_mbm_local",
"cqm_mbm_total",
"cqm_occup_llc",
"decodeassists",
"extapic",
"extd_apicid",
"flushbyasid",
"hw_pstate",
"ibs",
"irperf",
"lbrv",
"mba",
"monitor",
"mwaitx",
"overflow_recov",
"pausefilter",
"perfctr_llc",
"perfctr_nb",
"pfthreshold",
"rdpru",
"rdt_a",
"sev",
"sev_es",
"skinit",
"smca",
"sme",
"succor",
"svm_lock",
"tce",
"tsc_scale",
"v_vmsave_vmload",
"vgif",
"vmcb_clean",
"wdt",
}



def test_host_vs_guest_cpu_features(uvm_nano):
"""Check CPU features host vs guest"""
Expand All @@ -82,52 +128,8 @@ def test_host_vs_guest_cpu_features(uvm_nano):

match CPU_MODEL:
case CpuModel.AMD_MILAN:
host_guest_diff_5_10 = {
"amd_ppin",
"aperfmperf",
"bpext",
"cat_l3",
"cdp_l3",
"cpb",
"cqm",
"cqm_llc",
"cqm_mbm_local",
"cqm_mbm_total",
"cqm_occup_llc",
"decodeassists",
"extapic",
"extd_apicid",
"flushbyasid",
"hw_pstate",
"ibs",
"irperf",
"lbrv",
"mba",
"monitor",
"mwaitx",
"overflow_recov",
"pausefilter",
"perfctr_llc",
"perfctr_nb",
"pfthreshold",
"rdpru",
"rdt_a",
"sev",
"sev_es",
"skinit",
"smca",
"sme",
"succor",
"svm_lock",
"tce",
"tsc_scale",
"v_vmsave_vmload",
"vgif",
"vmcb_clean",
"wdt",
}

host_guest_diff_6_1 = host_guest_diff_5_10 - {
host_guest_diff_6_1 = AMD_HOST_ONLY_FEATS - {
"lbrv",
"pausefilter",
"pfthreshold",
Expand All @@ -139,7 +141,7 @@ def test_host_vs_guest_cpu_features(uvm_nano):
} | {"brs", "rapl", "v_spec_ctrl"}

if global_props.host_linux_version_tpl < (6, 1):
assert host_feats - guest_feats == host_guest_diff_5_10
assert host_feats - guest_feats == AMD_HOST_ONLY_FEATS
else:
assert host_feats - guest_feats == host_guest_diff_6_1

Expand All @@ -150,6 +152,15 @@ def test_host_vs_guest_cpu_features(uvm_nano):
"tsc_known_freq",
}

case CpuModel.AMD_GENOA:
assert host_feats - guest_feats == AMD_HOST_ONLY_FEATS
assert guest_feats - host_feats == {
"hypervisor",
"tsc_adjust",
"tsc_deadline_timer",
"tsc_known_freq",
}

case CpuModel.INTEL_SKYLAKE:
assert host_feats - guest_feats == INTEL_HOST_ONLY_FEATS
assert guest_feats - host_feats == {
Expand Down

0 comments on commit 7e0aaab

Please sign in to comment.