qemu-e2k/hw
Peter Maydell 1904f9b5f1 hw/intc/arm_gic_kvm: Don't assume kernel can provide a GICv2
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
2020-02-28 16:14:57 +00:00
..
9pfs
acpi mem: move nvdimm_device_list to utilities 2020-02-21 09:15:03 +11:00
adc
alpha
arm hw/arm/xilinx_zynq: Fix USB port instantiation 2020-02-28 16:14:57 +00:00
audio
block Xen queue 2020-02-27 2020-02-28 10:27:34 +00:00
char
core multifd: Add zstd compression multifd support 2020-02-28 09:25:49 +01:00
cpu cpu/arm11mpcore: Set number of GIC priority bits to 4 2020-02-28 16:14:57 +00:00
cris cris/axis_dev88: use memdev for RAM 2020-02-19 16:49:57 +00:00
display Merge branch 'exec_rw_const_v4' of https://github.com/philmd/qemu into HEAD 2020-02-25 13:41:48 +01:00
dma Avoid address_space_rw() with a constant is_write argument 2020-02-20 14:47:08 +01:00
gpio
hppa Merge tag 'patchew/20200219160953.13771-1-imammedo@redhat.com' of https://github.com/patchew-project/qemu into HEAD 2020-02-25 09:19:00 +01:00
hyperv
i2c
i386 x86/pc: use memdev for RAM 2020-02-19 16:49:58 +00:00
ide hw/ide: Let the DMAIntFunc prototype use a boolean 'is_write' argument 2020-02-20 14:47:08 +01:00
input
intc hw/intc/arm_gic_kvm: Don't assume kernel can provide a GICv2 2020-02-28 16:14:57 +00:00
ipack
ipmi
isa
lm32 lm32/milkymist: use memdev for RAM 2020-02-19 16:49:58 +00:00
m68k Merge tag 'patchew/20200219160953.13771-1-imammedo@redhat.com' of https://github.com/patchew-project/qemu into HEAD 2020-02-25 09:19:00 +01:00
mem spapr: Add NVDIMM device support 2020-02-21 09:15:04 +11:00
microblaze
mips hw/mips: Use memory_region_init_rom() with read-only regions 2020-02-27 14:18:47 +01:00
misc Merge branch 'exec_rw_const_v4' of https://github.com/philmd/qemu into HEAD 2020-02-25 13:41:48 +01:00
moxie
net Merge branch 'exec_rw_const_v4' of https://github.com/philmd/qemu into HEAD 2020-02-25 13:41:48 +01:00
nios2
nubus
nvram Let cpu_[physical]_memory() calls pass a boolean 'is_write' argument 2020-02-20 14:47:08 +01:00
openrisc
pci
pci-bridge
pci-host pnv/phb3: Add missing break statement 2020-02-21 09:15:04 +11:00
pcmcia
ppc Merge branch 'exec_rw_const_v4' of https://github.com/philmd/qemu into HEAD 2020-02-25 13:41:48 +01:00
rdma
riscv
rtc
s390x s390x: Rename and use constants for short PSW address and mask 2020-02-27 11:10:29 +01:00
scsi Merge branch 'exec_rw_const_v4' of https://github.com/philmd/qemu into HEAD 2020-02-25 13:41:48 +01:00
sd hw: Remove unnecessary cast when calling dma_memory_read() 2020-02-20 14:47:08 +01:00
semihosting
sh4 sh4: Fix PCI ISA IO memory subregion 2020-02-21 16:07:02 +00:00
smbios
sparc sparc/sun4m: use memdev for RAM 2020-02-19 16:50:01 +00:00
sparc64 sparc/niagara: use memdev for RAM 2020-02-19 16:50:01 +00:00
ssi xilinx_spips: Correct the number of dummy cycles for the FAST_READ_4 cmd 2020-02-21 16:07:02 +00:00
timer
tpm
tricore
unicore32
usb hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx, ps7-usb class 2020-02-28 16:14:57 +00:00
vfio
virtio virtio, pc: fixes, features 2020-02-27 19:15:15 +00:00
watchdog
xen xen-bus/block: explicitly assign event channels to an AioContext 2020-02-27 11:50:30 +00:00
xenpv
xtensa
Kconfig
Makefile.objs