mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Seperate the CPUID setup from the CpuManager::new()
This allows the decoupling of CpuManager and MemoryManager. See: #4761 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -525,13 +525,12 @@ impl Vm {
|
||||
let cpus_config = { &config.lock().unwrap().cpus.clone() };
|
||||
let cpu_manager = cpu::CpuManager::new(
|
||||
cpus_config,
|
||||
&memory_manager,
|
||||
vm.clone(),
|
||||
exit_evt.try_clone().map_err(Error::EventFdClone)?,
|
||||
reset_evt.try_clone().map_err(Error::EventFdClone)?,
|
||||
#[cfg(feature = "guest_debug")]
|
||||
vm_debug_evt,
|
||||
hypervisor.clone(),
|
||||
&hypervisor,
|
||||
seccomp_action.clone(),
|
||||
vm_ops,
|
||||
#[cfg(feature = "tdx")]
|
||||
@@ -540,6 +539,18 @@ impl Vm {
|
||||
)
|
||||
.map_err(Error::CpuManager)?;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.populate_cpuid(
|
||||
&memory_manager,
|
||||
&hypervisor,
|
||||
#[cfg(feature = "tdx")]
|
||||
tdx_enabled,
|
||||
)
|
||||
.map_err(Error::CpuManager)?;
|
||||
|
||||
cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
@@ -2487,7 +2498,7 @@ impl Snapshottable for Vm {
|
||||
let common_cpuid = {
|
||||
let phys_bits = physical_bits(self.config.lock().unwrap().cpus.max_phys_bits);
|
||||
arch::generate_common_cpuid(
|
||||
self.hypervisor.clone(),
|
||||
&self.hypervisor,
|
||||
None,
|
||||
None,
|
||||
phys_bits,
|
||||
|
||||
Reference in New Issue
Block a user