mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: cpu: Split vCPU creation
Split the vCPU creation into two distincts parts. On the one hand we create the actual Vcpu object with the creation of the hypervisor::Vcpu. And on the other hand, we configure the existing Vcpu, setting registers to proper values (such as setting the entry point). This will allow for further work to move the creation earlier in the boot, so that the hypervisor::Vcpu will be already created when the DeviceManager gets created. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
+9
-6
@@ -2087,12 +2087,15 @@ impl Vm {
|
||||
self.init_tdx()?;
|
||||
}
|
||||
|
||||
// Create and configure vcpus
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.create_boot_vcpus(entry_point)
|
||||
.map_err(Error::CpuManager)?;
|
||||
// Configure the vcpus that have been created
|
||||
let vcpus = self.cpu_manager.lock().unwrap().vcpus();
|
||||
for vcpu in vcpus {
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.configure_vcpu(vcpu, entry_point, None)
|
||||
.map_err(Error::CpuManager)?;
|
||||
}
|
||||
|
||||
#[cfg(feature = "tdx")]
|
||||
let sections = if tdx_enabled {
|
||||
|
||||
Reference in New Issue
Block a user