1904f9b5f1
In our KVM GICv2 realize function, we try to cope with old kernels that don't provide the device control API (KVM_CAP_DEVICE_CTRL): we try to use the device control, and if that fails we fall back to assuming that the kernel has the old style KVM_CREATE_IRQCHIP and that it will provide a GICv2. This doesn't cater for the possibility of a kernel and hardware which only provide a GICv3, which is very common now. On that setup we will abort() later on in kvm_arm_pmu_set_irq() when we try to wire up an interrupt to the GIC we failed to create: qemu-system-aarch64: PMU: KVM_SET_DEVICE_ATTR: Invalid argument qemu-system-aarch64: failed to set irq for PMU Aborted If the kernel advertises KVM_CAP_DEVICE_CTRL we should trust it if it says it can't create a GICv2, rather than assuming it has one. We can then produce a more helpful error message including a hint about the most probable reason for the failure. If the kernel doesn't advertise KVM_CAP_DEVICE_CTRL then it is truly ancient by this point but we might as well still fall back to a KVM_CREATE_IRQCHIP GICv2. With this patch then the user misconfiguration which previously caused an abort now prints: qemu-system-aarch64: Initialization of device kvm-arm-gic failed: error creating in-kernel VGIC: No such device Perhaps the host CPU does not support GICv2? Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Tested-by: Andrew Jones <drjones@redhat.com> Message-id: 20200225182435.1131-1-peter.maydell@linaro.org |
||
---|---|---|
.. | ||
allwinner-a10-pic.c | ||
apic_common.c | ||
apic.c | ||
arm_gic_common.c | ||
arm_gic_kvm.c | ||
arm_gic.c | ||
arm_gicv2m.c | ||
arm_gicv3_common.c | ||
arm_gicv3_cpuif.c | ||
arm_gicv3_dist.c | ||
arm_gicv3_its_common.c | ||
arm_gicv3_its_kvm.c | ||
arm_gicv3_kvm.c | ||
arm_gicv3_redist.c | ||
arm_gicv3.c | ||
armv7m_nvic.c | ||
aspeed_vic.c | ||
bcm2835_ic.c | ||
bcm2836_control.c | ||
etraxfs_pic.c | ||
exynos4210_combiner.c | ||
exynos4210_gic.c | ||
gic_internal.h | ||
gicv3_internal.h | ||
grlib_irqmp.c | ||
heathrow_pic.c | ||
i8259_common.c | ||
i8259.c | ||
imx_avic.c | ||
imx_gpcv2.c | ||
intc.c | ||
ioapic_common.c | ||
ioapic.c | ||
Kconfig | ||
lm32_pic.c | ||
Makefile.objs | ||
mips_gic.c | ||
nios2_iic.c | ||
omap_intc.c | ||
ompic.c | ||
openpic_kvm.c | ||
openpic.c | ||
pl190.c | ||
pnv_xive_regs.h | ||
pnv_xive.c | ||
puv3_intc.c | ||
realview_gic.c | ||
s390_flic_kvm.c | ||
s390_flic.c | ||
sh_intc.c | ||
slavio_intctl.c | ||
spapr_xive_kvm.c | ||
spapr_xive.c | ||
trace-events | ||
vgic_common.h | ||
xics_kvm.c | ||
xics_pnv.c | ||
xics_spapr.c | ||
xics.c | ||
xilinx_intc.c | ||
xive.c | ||
xlnx-pmu-iomod-intc.c | ||
xlnx-zynqmp-ipi.c |