mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Make CPU profile part of various configs
We integrate the CPU profile into the various configs that ultimately get set by the user. This quickly ends up involving multiple files, luckily Rust helps us find which ones via compilation errors. Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de> On-behalf-of: SAP oliver.anderson@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
a9440d2919
commit
549f3d6c04
@@ -3359,19 +3359,28 @@ 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.as_ref(),
|
||||
self.config.lock().unwrap().cpus.max_phys_bits,
|
||||
);
|
||||
let (amx, max_phys_bits, kvm_hyperv, profile) = {
|
||||
let guard = self.config.lock().unwrap();
|
||||
let VmConfig { cpus, .. } = &*guard;
|
||||
(
|
||||
cpus.features.amx,
|
||||
cpus.max_phys_bits,
|
||||
cpus.kvm_hyperv,
|
||||
cpus.profile,
|
||||
)
|
||||
};
|
||||
|
||||
let phys_bits = physical_bits(self.hypervisor.as_ref(), max_phys_bits);
|
||||
|
||||
arch::generate_common_cpuid(
|
||||
self.hypervisor.as_ref(),
|
||||
&arch::CpuidConfig {
|
||||
phys_bits,
|
||||
kvm_hyperv: self.config.lock().unwrap().cpus.kvm_hyperv,
|
||||
kvm_hyperv,
|
||||
#[cfg(feature = "tdx")]
|
||||
tdx: false,
|
||||
amx,
|
||||
profile,
|
||||
},
|
||||
)
|
||||
.map_err(|e| {
|
||||
|
||||
Reference in New Issue
Block a user