mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
arch, vmm: Clear AMX CPUID bits if the feature is not enabled
Fixes: #5833 Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
@@ -745,6 +745,7 @@ impl CpuManager {
|
||||
kvm_hyperv: self.config.kvm_hyperv,
|
||||
#[cfg(feature = "tdx")]
|
||||
tdx,
|
||||
amx: self.config.features.amx,
|
||||
},
|
||||
)
|
||||
.map_err(Error::CommonCpuId)?
|
||||
|
||||
@@ -1665,6 +1665,7 @@ impl Vmm {
|
||||
let common_cpuid = {
|
||||
#[cfg(feature = "tdx")]
|
||||
let tdx = vm_config.lock().unwrap().is_tdx_enabled();
|
||||
let amx = vm_config.lock().unwrap().cpus.features.amx;
|
||||
let phys_bits =
|
||||
vm::physical_bits(&hypervisor, vm_config.lock().unwrap().cpus.max_phys_bits);
|
||||
arch::generate_common_cpuid(
|
||||
@@ -1675,6 +1676,7 @@ impl Vmm {
|
||||
kvm_hyperv: vm_config.lock().unwrap().cpus.kvm_hyperv,
|
||||
#[cfg(feature = "tdx")]
|
||||
tdx,
|
||||
amx,
|
||||
},
|
||||
)
|
||||
.map_err(|e| {
|
||||
@@ -1866,6 +1868,7 @@ impl Vmm {
|
||||
kvm_hyperv: vm_config.cpus.kvm_hyperv,
|
||||
#[cfg(feature = "tdx")]
|
||||
tdx: vm_config.is_tdx_enabled(),
|
||||
amx: vm_config.cpus.features.amx,
|
||||
},
|
||||
)
|
||||
.map_err(|e| {
|
||||
|
||||
@@ -2409,6 +2409,7 @@ impl Snapshottable for Vm {
|
||||
|
||||
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
|
||||
let common_cpuid = {
|
||||
let amx = self.config.lock().unwrap().cpus.features.amx;
|
||||
let phys_bits = physical_bits(
|
||||
&self.hypervisor,
|
||||
self.config.lock().unwrap().cpus.max_phys_bits,
|
||||
@@ -2421,6 +2422,7 @@ impl Snapshottable for Vm {
|
||||
kvm_hyperv: self.config.lock().unwrap().cpus.kvm_hyperv,
|
||||
#[cfg(feature = "tdx")]
|
||||
tdx: tdx_enabled,
|
||||
amx,
|
||||
},
|
||||
)
|
||||
.map_err(|e| {
|
||||
|
||||
Reference in New Issue
Block a user