From ed3a42bc9db86ddb90dee7300915d2d3c3c87872 Mon Sep 17 00:00:00 2001 From: Oliver Anderson Date: Tue, 9 Dec 2025 14:20:43 +0100 Subject: [PATCH] vmm: Enable AMX states prior to checking CPUID compatibility Since enabling AMX tile state components affect the result returned by `Hypervisor::get_supported_cpuid` we want this enabled prior to checking CPUID compatibility between the source and destination VMs. Although this is not required right now, it will be necessary once we introduce CPU profiles and it will also be necessary if we decide to make `check_cpuid_compatibility` (arguably) more thorough by also taking state components into account. Signed-off-by: Oliver Anderson On-behalf-of: SAP oliver.anderson@sap.com --- vmm/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index 548eb23fe..9f0735f1a 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -1584,8 +1584,17 @@ impl Vmm { let dest_cpuid = &{ let vm_config = &src_vm_config.lock().unwrap(); + if vm_config.cpus.features.amx { + // Need to enable AMX tile state components before generating common cpuid + // as this affects what Hypervisor::get_supported_cpuid returns. + self.hypervisor + .enable_amx_state_components() + .map_err(|e| MigratableError::MigrateReceive(e.into()))?; + } + let phys_bits = vm::physical_bits(self.hypervisor.as_ref(), vm_config.cpus.max_phys_bits); + arch::generate_common_cpuid( self.hypervisor.as_ref(), &arch::CpuidConfig {