mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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>
This commit is contained in:
parent
07f48730bc
commit
3f07cb2aab
4 changed files with 53 additions and 36 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue