arm64: Initialise the PMU after the GIC
PMU initialisation is done in:
setup_fdt()
vcpu->generate_fdt_nodes()
pmu__generate_fdt_nodes()
The PMU ioctl KVM_ARM_VCPU_PMU_V3_INIT requires that the GIC has been
initialised, which is done in gic__init_gic().
gic__init_gic() and setup_fdt() are part of the same initialisation list.
The relative order on the list depends on the order of compilation: gic.c
is compiled after fdt.c and this places gic__init_gic() first on the
initialisation list.
If the compilation order changes and gic.c is compiled *before* fdt.c,
gic__init_gic() will be executed *after* setup_fdt() and PMU initialisation
will fail with an error message:
PMU KVM_SET_DEVICE_ATTR: No such device
This is fragile and hard to debug. Improve the situation by having
gic__init_gic() explicitely initialize the PMU.
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
3 files changed