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:
Jianyong Wu
2022-01-15 15:27:55 +08:00
committed by Xin Wang
parent 9bcb984962
commit 53060874a7
3 changed files with 62 additions and 0 deletions
+10
View File
@@ -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(),