From b16595275bc9b9ce6a36bfb0344d514ab77e6b98 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Sep 2017 15:21:54 +0100 Subject: hw/arm/virt: allow pmu instantiation with userspace irqchip Move the in-kernel-irqchip test to only guard the set-irq stage, not the init stage of the PMU. Also add the PMU to the KVM device irq line synchronization to enable its use. Signed-off-by: Andrew Jones Reviewed-by: Christoffer Dall Message-id: 1500471597-2517-4-git-send-email-drjones@redhat.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/kvm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'target/arm/kvm.c') diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 7c17f0d629..211a7bf7be 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -567,7 +567,11 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run) switched_level &= ~KVM_ARM_DEV_EL1_PTIMER; } - /* XXX PMU IRQ is missing */ + if (switched_level & KVM_ARM_DEV_PMU) { + qemu_set_irq(cpu->pmu_interrupt, + !!(run->s.regs.device_irq_level & KVM_ARM_DEV_PMU)); + switched_level &= ~KVM_ARM_DEV_PMU; + } if (switched_level) { qemu_log_mask(LOG_UNIMP, "%s: unhandled in-kernel device IRQ %x\n", -- cgit v1.2.3