fix: xen: consider Xen dom0 as non-guest (#343 continued)

(cherry picked from commit bc00a81526)
This commit is contained in:
Stéphane Lesimple
2026-08-08 17:23:47 +00:00
parent cc29aaba6b
commit d5cbaaa7c3
5 changed files with 62 additions and 17 deletions
+15 -5
View File
@@ -175,11 +175,21 @@ check_mds_linux() {
mds_smt_mitigated=1
pstatus green YES
elif echo "$ret_sys_interface_check_fullmsg" | grep -q 'SMT Host state unknown'; then
# The kernel appends "SMT Host state unknown" when running under
# a hypervisor (X86_FEATURE_HYPERVISOR): the host controls SMT
# scheduling, so it can't be determined from inside the guest (#343).
mds_smt_mitigated=2
pstatus yellow UNKNOWN "running in a VM guest, the hypervisor host controls SMT"
# The kernel appends "SMT Host state unknown" whenever the
# HYPERVISOR CPUID bit is set. That's true both inside a guest
# AND on a Xen dom0 (#343). In a guest we genuinely can't see
# the host's SMT scheduling; on dom0/bare metal the local SMT
# state is authoritative, so trust it there.
if is_running_as_guest; then
mds_smt_mitigated=2
pstatus yellow UNKNOWN "running in a VM guest, the hypervisor host controls SMT"
elif is_cpu_smt_enabled; then
mds_smt_mitigated=0
pstatus yellow NO
else
mds_smt_mitigated=1
pstatus green YES
fi
else
mds_smt_mitigated=0
pstatus yellow NO