Skip to content

Commit 440f1d4

Browse files
committed
fix(tests): bring back the AMD Genoa check
Fixes: f4f7536 Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent 1f94a59 commit 440f1d4

File tree

1 file changed

+85
-62
lines changed

1 file changed

+85
-62
lines changed

tests/integration_tests/functional/test_cpu_features_host_vs_guest.py

Lines changed: 85 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,82 @@
7070
"xtpr",
7171
}
7272

73+
AMD_HOST_ONLY_FEATS = {
74+
"amd_ppin",
75+
"aperfmperf",
76+
"bpext",
77+
"cat_l3",
78+
"cdp_l3",
79+
"cpb",
80+
"cqm",
81+
"cqm_llc",
82+
"cqm_mbm_local",
83+
"cqm_mbm_total",
84+
"cqm_occup_llc",
85+
"decodeassists",
86+
"extapic",
87+
"extd_apicid",
88+
"flushbyasid",
89+
"hw_pstate",
90+
"ibs",
91+
"irperf",
92+
"lbrv",
93+
"mba",
94+
"monitor",
95+
"mwaitx",
96+
"overflow_recov",
97+
"pausefilter",
98+
"perfctr_llc",
99+
"perfctr_nb",
100+
"pfthreshold",
101+
"rdpru",
102+
"rdt_a",
103+
"sev",
104+
"sev_es",
105+
"skinit",
106+
"smca",
107+
"sme",
108+
"succor",
109+
"svm_lock",
110+
"tce",
111+
"tsc_scale",
112+
"v_vmsave_vmload",
113+
"vgif",
114+
"vmcb_clean",
115+
"wdt",
116+
}
117+
118+
AMD_GUEST_ONLY_FEATS = {
119+
"hypervisor", "tsc_adjust", "tsc_deadline_timer", "tsc_known_freq",
120+
}
121+
122+
AMD_HOST_ONLY_FEATS_6_1 = AMD_HOST_ONLY_FEATS - {
123+
"lbrv",
124+
"pausefilter",
125+
"pfthreshold",
126+
"sme",
127+
"tsc_scale",
128+
"v_vmsave_vmload",
129+
"vgif",
130+
"vmcb_clean",
131+
} | {"brs", "rapl", "v_spec_ctrl"}
132+
133+
AMD_GENOA_HOST_ONLY_FEATS = AMD_HOST_ONLY_FEATS | {
134+
"avic",
135+
"flush_l1d",
136+
"ibrs_enhanced",
137+
}
138+
139+
AMD_GENOA_HOST_ONLY_FEATS_6_1 = AMD_HOST_ONLY_FEATS_6_1 | {
140+
'amd_lbr_v2',
141+
"avic",
142+
'cppc',
143+
"flush_l1d",
144+
"ibrs_enhanced",
145+
'perfmon_v2',
146+
"x2avic",
147+
}
148+
73149

74150
def test_host_vs_guest_cpu_features(uvm_nano):
75151
"""Check CPU features host vs guest"""
@@ -82,73 +158,20 @@ def test_host_vs_guest_cpu_features(uvm_nano):
82158

83159
match CPU_MODEL:
84160
case CpuModel.AMD_MILAN:
85-
host_guest_diff_5_10 = {
86-
"amd_ppin",
87-
"aperfmperf",
88-
"bpext",
89-
"cat_l3",
90-
"cdp_l3",
91-
"cpb",
92-
"cqm",
93-
"cqm_llc",
94-
"cqm_mbm_local",
95-
"cqm_mbm_total",
96-
"cqm_occup_llc",
97-
"decodeassists",
98-
"extapic",
99-
"extd_apicid",
100-
"flushbyasid",
101-
"hw_pstate",
102-
"ibs",
103-
"irperf",
104-
"lbrv",
105-
"mba",
106-
"monitor",
107-
"mwaitx",
108-
"overflow_recov",
109-
"pausefilter",
110-
"perfctr_llc",
111-
"perfctr_nb",
112-
"pfthreshold",
113-
"rdpru",
114-
"rdt_a",
115-
"sev",
116-
"sev_es",
117-
"skinit",
118-
"smca",
119-
"sme",
120-
"succor",
121-
"svm_lock",
122-
"tce",
123-
"tsc_scale",
124-
"v_vmsave_vmload",
125-
"vgif",
126-
"vmcb_clean",
127-
"wdt",
128-
}
161+
if global_props.host_linux_version_tpl < (6, 1):
162+
assert host_feats - guest_feats == AMD_HOST_ONLY_FEATS
163+
else:
164+
assert host_feats - guest_feats == AMD_HOST_ONLY_FEATS_6_1
129165

130-
host_guest_diff_6_1 = host_guest_diff_5_10 - {
131-
"lbrv",
132-
"pausefilter",
133-
"pfthreshold",
134-
"sme",
135-
"tsc_scale",
136-
"v_vmsave_vmload",
137-
"vgif",
138-
"vmcb_clean",
139-
} | {"brs", "rapl", "v_spec_ctrl"}
166+
assert guest_feats - host_feats == AMD_GUEST_ONLY_FEATS
140167

168+
case CpuModel.AMD_GENOA:
141169
if global_props.host_linux_version_tpl < (6, 1):
142-
assert host_feats - guest_feats == host_guest_diff_5_10
170+
assert host_feats - guest_feats == AMD_GENOA_HOST_ONLY_FEATS
143171
else:
144-
assert host_feats - guest_feats == host_guest_diff_6_1
172+
assert host_feats - guest_feats == AMD_GENOA_HOST_ONLY_FEATS_6_1
145173

146-
assert guest_feats - host_feats == {
147-
"hypervisor",
148-
"tsc_adjust",
149-
"tsc_deadline_timer",
150-
"tsc_known_freq",
151-
}
174+
assert guest_feats - host_feats == AMD_GUEST_ONLY_FEATS
152175

153176
case CpuModel.INTEL_SKYLAKE:
154177
assert host_feats - guest_feats == INTEL_HOST_ONLY_FEATS

0 commit comments

Comments
 (0)