Use the GICv5 PPI specifier in the DT. KVM also expects the PMU IRQ attribute to contain the GICv5 interrupt type in the upper bits, so encode it before setting KVM_ARM_VCPU_PMU_V3_IRQ. Tested-by: Vladimir Murzin Signed-off-by: Sascha Bischoff --- arm64/pmu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/arm64/pmu.c b/arm64/pmu.c index ef7faca1..b3026d50 100644 --- a/arm64/pmu.c +++ b/arm64/pmu.c @@ -214,16 +214,17 @@ static int find_pmu(struct kvm *kvm) void pmu__generate_fdt_nodes(void *fdt, struct kvm *kvm) { const char compatible[] = "arm,armv8-pmuv3"; + int irq = KVM_ARM_PMUv3_PPI; + u32 irq_prop[3]; u32 cpu_mask = gic__get_fdt_irq_cpumask(kvm); - u32 irq_prop[] = { - cpu_to_fdt32(GIC_FDT_IRQ_TYPE_PPI), - cpu_to_fdt32(KVM_ARM_PMUv3_PPI - 16), - cpu_to_fdt32(cpu_mask | IRQ_TYPE_LEVEL_HIGH), - }; if (!kvm->cfg.arch.has_pmuv3) return; + irq_prop[0] = cpu_to_fdt32(gic__get_ppi_fdt_type()); + irq_prop[1] = cpu_to_fdt32(irq - gic__get_ppi_base()); + irq_prop[2] = cpu_to_fdt32(cpu_mask | IRQ_TYPE_LEVEL_HIGH); + _FDT(fdt_begin_node(fdt, "pmu")); _FDT(fdt_property(fdt, "compatible", compatible, sizeof(compatible))); _FDT(fdt_property(fdt, "interrupts", irq_prop, sizeof(irq_prop))); @@ -248,6 +249,8 @@ int pmu__init(struct kvm *kvm) } } + irq = gic__encode_ppi_irq(kvm->cfg.arch.irqchip, irq); + for (i = 0; i < kvm->nrcpus; i++) { vcpu = kvm->cpus[i]; set_pmu_attr(vcpu, &irq, KVM_ARM_VCPU_PMU_V3_IRQ); -- 2.34.1