vmm: mshv: Set PROCESSORS_PER_SOCKET property for CPU topologies

On MSHV, exposing multithreaded CPU topologies requires setting the
PROCESSORS_PER_SOCKET partition property so that CPUID.0xB reports
correct logical processor counts and topology levels to the guest.

This property must be set after all vCPUs are configured, as the
hypervisor uses the complete vCPU layout to derive and report CPU
topology information.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2025-12-22 21:06:52 +00:00
committed by Bo Chen
parent dccdb223b7
commit 3657db7843
3 changed files with 43 additions and 0 deletions
+9
View File
@@ -2415,6 +2415,15 @@ impl Vm {
.map_err(Error::CpuManager)?;
}
#[cfg(feature = "mshv")]
{
self.cpu_manager
.lock()
.unwrap()
.set_processors_per_socket_property()
.ok();
}
#[cfg(feature = "tdx")]
let (sections, guid_found) = if tdx_enabled {
self.extract_tdvf_sections()?