diff options
author | Andrew Jones <drjones@redhat.com> | 2017-09-04 15:21:54 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-09-04 15:21:54 +0100 |
commit | 3f07cb2aabdfcc27ee30cf85c39619a82d364f83 (patch) | |
tree | c62d128a9af401a6f2e40359f4a1b032967ea909 /hw/arm | |
parent | 07f48730bc4ec99f128901705336eb455f674694 (diff) | |
download | qemu-3f07cb2aabdfcc27ee30cf85c39619a82d364f83.zip qemu-3f07cb2aabdfcc27ee30cf85c39619a82d364f83.tar.gz qemu-3f07cb2aabdfcc27ee30cf85c39619a82d364f83.tar.bz2 |
target/arm/kvm: pmu: split init and set-irq stages
When adding a PMU with a userspace irqchip we skip the set-irq
stage of device creation. Split the 'create' function into two
functions 'init' and 'set-irq' so they may be called separately.
Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Message-id: 1500471597-2517-3-git-send-email-drjones@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm')
-rw-r--r-- | hw/arm/virt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a06ec13..d6e2486 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -492,10 +492,17 @@ static void fdt_add_pmu_nodes(const VirtMachineState *vms) CPU_FOREACH(cpu) { armcpu = ARM_CPU(cpu); - if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU) || - (kvm_enabled() && !kvm_arm_pmu_create(cpu, PPI(VIRTUAL_PMU_IRQ)))) { + if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) { return; } + if (kvm_enabled()) { + if (!kvm_arm_pmu_set_irq(cpu, PPI(VIRTUAL_PMU_IRQ))) { + return; + } + if (!kvm_arm_pmu_init(cpu)) { + return; + } + } } if (vms->gic_version == 2) { |