mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Init PMU for vcpu when create vm
PMU is needed in guest for performance profiling, thus should be enabled. Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
This commit is contained in:
@@ -1151,6 +1151,16 @@ impl Vm {
|
||||
Error::ConfigureSystem(arch::Error::AArch64Setup(arch::aarch64::Error::SetupGic(e)))
|
||||
})?;
|
||||
|
||||
// PMU interrupt sticks to PPI, so need to be added by 16 to get real irq number.
|
||||
let pmu_supported = self
|
||||
.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.init_pmu(arch::aarch64::fdt::AARCH64_PMU_IRQ + 16)
|
||||
.map_err(|_| {
|
||||
Error::ConfigureSystem(arch::Error::AArch64Setup(arch::aarch64::Error::VcpuInitPmu))
|
||||
})?;
|
||||
|
||||
arch::configure_system(
|
||||
&mem,
|
||||
cmdline.as_str(),
|
||||
|
||||
Reference in New Issue
Block a user