diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index 8f9f85e59..98d59c8ba 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -502,7 +502,6 @@ impl CpuManager { ioapic, creation_ts, )?; - vcpu.configure(entry_addr, &self.vm_memory, self.cpuid.clone())?; let vcpu_thread_barrier = vcpu_thread_barrier.clone(); @@ -510,6 +509,9 @@ impl CpuManager { let vcpu_kill_signalled = self.vcpus_kill_signalled.clone(); let vcpu_pause_signalled = self.vcpus_pause_signalled.clone(); + let vm_memory = self.vm_memory.clone(); + let cpuid = self.cpuid.clone(); + let handle = Some( thread::Builder::new() .name(format!("vcpu{}", vcpu.id)) @@ -527,6 +529,9 @@ impl CpuManager { .expect("Failed to register vcpu signal handler"); } + vcpu.configure(entry_addr, &vm_memory, cpuid) + .expect("Failed to configure vCPU"); + // Block until all CPUs are ready. vcpu_thread_barrier.wait();