hypervisor: vmm: mshv: Enable SMT for guests with threads_per_core > 1

Set HV_PARTITION_CREATION_FLAG_SMT_ENABLED_GUEST when the guest
topology has more than one thread per core. This allows the
hypervisor to schedule guest VPs correctly on SMT-enabled hosts.

Without this flag, the hypervisor schedules guest VPs incorrectly,
causing SMT unusable.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-01-19 19:15:12 +01:00
committed by Rob Bradford
parent e3a2bf0870
commit a00189cf72
3 changed files with 10 additions and 0 deletions
+5
View File
@@ -221,6 +221,11 @@ impl From<&VmConfig> for hypervisor::HypervisorVmConfig {
#[cfg(feature = "sev_snp")]
mem_size: _value.memory.total_size(),
nested: _value.cpus.nested,
smt_enabled: _value
.cpus
.topology
.as_ref()
.is_some_and(|t| t.threads_per_core > 1),
}
}
}