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 <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
This commit is contained in:
Oliver Anderson
2025-12-09 14:20:43 +01:00
committed by Rob Bradford
parent 39c27e1312
commit ed3a42bc9d

View File

@@ -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 {