mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-21 19:02:30 +00:00
vmm: vm: Init PMU during the VM restore process
If a PMU is enabled in a VM, we also need to initialize the PMU when the VM is restored. Otherwise, vCPUs cannot be started after the VM is restored. Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
parent
5462fd810c
commit
8f4aa07a80
@ -2142,6 +2142,13 @@ impl Vm {
|
||||
let mut gic_device = create_gic(&self.vm, vcpu_numbers.try_into().unwrap())
|
||||
.map_err(|e| MigratableError::Restore(anyhow!("Could not create GIC: {:#?}", e)))?;
|
||||
|
||||
// PMU interrupt sticks to PPI, so need to be added by 16 to get real irq number.
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.init_pmu(arch::aarch64::fdt::AARCH64_PMU_IRQ + 16)
|
||||
.map_err(|e| MigratableError::Restore(anyhow!("Error init PMU: {:?}", e)))?;
|
||||
|
||||
// Here we prepare the GICR_TYPER registers from the restored vCPU states.
|
||||
gic_device.set_gicr_typers(&saved_vcpu_states);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user