qemu/hw/intc
Greg Kurz e519cdd9bc ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers
Calls to the KVM XIVE device are guarded by kvm_irqchip_in_kernel(). This
ensures that QEMU won't try to use the device if KVM is disabled or if
an in-kernel irqchip isn't required.

When using ic-mode=dual with the pseries machine, we have two possible
interrupt controllers: XIVE and XICS. The kvm_irqchip_in_kernel() helper
will return true as soon as any of the KVM device is created. It might
lure QEMU to think that the other one is also around, while it is not.
This is exactly what happens with ic-mode=dual at machine init when
claiming IRQ numbers, which must be done on all possible IRQ backends,
eg. RTAS event sources or the PHB0 LSI table : only the KVM XICS device
is active but we end up calling kvmppc_xive_source_reset_one() anyway,
which fails. This doesn't cause any trouble because of another bug :
kvmppc_xive_source_reset_one() lacks an error_setg() and callers don't
see the failure.

Most of the other kvmppc_xive_* functions have similar xive->fd
checks to filter out the case when KVM XIVE isn't active. It
might look safer to have idempotent functions but it doesn't
really help to understand what's going on when debugging.

Since we already have all the kvm_irqchip_in_kernel() in place,
also have the callers to check xive->fd as well before calling
KVM XIVE specific code. This is straight-forward for the spapr
specific XIVE code. Some more care is needed for the platform
agnostic XIVE code since it cannot access xive->fd directly.
Introduce new in_kernel() methods in some base XIVE classes
for this purpose and implement them only in spapr.

In all cases, we still need to call kvm_irqchip_in_kernel() so that
compilers can optimize the kvmppc_xive_* calls away when CONFIG_KVM
isn't defined, thus avoiding the need for stubs.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <159679993438.876294.7285654331498605426.stgit@bahia.lan>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-08-13 20:56:01 +10:00
..
allwinner-a10-pic.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
apic_common.c apic: Report current_count via 'info lapic' 2020-07-10 19:26:55 -04:00
apic.c apic: Report current_count via 'info lapic' 2020-07-10 19:26:55 -04:00
arm_gic_common.c arm_gic: Mask the un-supported priority bits 2020-02-28 16:14:57 +00:00
arm_gic_kvm.c error: Avoid error_propagate() after migrate_add_blocker() 2020-07-10 15:18:08 +02:00
arm_gic.c arm_gic: Mask the un-supported priority bits 2020-02-28 16:14:57 +00:00
arm_gicv2m.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
arm_gicv3_common.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
arm_gicv3_cpuif.c arm/gicv3: update virtual irq state after IAR register read 2020-01-17 14:27:16 +00:00
arm_gicv3_dist.c hw/intc/arm_gicv3: GICD_TYPER.SecurityExtn is RAZ if GICD_CTLR.DS == 1 2019-06-17 15:13:19 +01:00
arm_gicv3_its_common.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
arm_gicv3_its_kvm.c error: Avoid error_propagate() after migrate_add_blocker() 2020-07-10 15:18:08 +02:00
arm_gicv3_kvm.c error: Avoid error_propagate() after migrate_add_blocker() 2020-07-10 15:18:08 +02:00
arm_gicv3_redist.c hw/intc/arm_gicv3: Fix decoding of ID register range 2019-06-17 15:13:19 +01:00
arm_gicv3.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
armv7m_nvic.c hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ 2020-08-03 17:55:03 +01:00
aspeed_vic.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
bcm2835_ic.c hw/arm/bcm283x: Correct the license text 2020-03-23 17:22:30 +00:00
bcm2836_control.c hw/arm/bcm283x: Correct the license text 2020-03-23 17:22:30 +00:00
etraxfs_pic.c cris: improve passing PIC interrupt vector to the CPU 2020-01-07 17:24:29 +04:00
exynos4210_combiner.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
exynos4210_gic.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
gic_internal.h
gicv3_internal.h
grlib_irqmp.c leon3: use qemu_irq framework instead of callback as property 2020-01-07 17:24:29 +04:00
heathrow_pic.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
i8259_common.c isa: Convert uses of isa_create() with Coccinelle 2020-06-15 22:05:28 +02:00
i8259.c hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
ibex_plic.c hw/intc: Initial commit of lowRISC Ibex PLIC 2020-06-19 08:24:07 -07:00
imx_avic.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
imx_gpcv2.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
intc.c
ioapic_common.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
ioapic.c KVM: Kick resamplefd for split kernel irqchip 2020-06-10 12:10:33 -04:00
Kconfig hw/intc: Add Loongson LIOINTC support 2020-06-27 19:42:22 +02:00
lm32_pic.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
loongson_liointc.c hw/intc: Add Loongson LIOINTC support 2020-06-27 19:42:22 +02:00
Makefile.objs hw/intc: Add Loongson LIOINTC support 2020-06-27 19:42:22 +02:00
mips_gic.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
nios2_iic.c qom: Don't handle impossible object_property_get_link() failure 2020-07-10 15:18:08 +02:00
omap_intc.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ompic.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
openpic_kvm.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
openpic.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pl190.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
pnv_xive_regs.h ppc/pnv: add a XIVE interrupt controller model for POWER9 2019-03-12 14:33:04 +11:00
pnv_xive.c error: Eliminate error_propagate() with Coccinelle, part 1 2020-07-10 15:18:08 +02:00
puv3_intc.c hw/unicore32/puv3: Use qemu_log_mask(ERROR) instead of debug printf() 2020-06-09 19:01:56 +02:00
realview_gic.c error: Eliminate error_propagate() with Coccinelle, part 1 2020-07-10 15:18:08 +02:00
rx_icu.c hw/intc: RX62N interrupt controller (ICUa) 2020-06-22 18:37:12 +02:00
s390_flic_kvm.c s390x: adapter routes error handling 2020-01-27 12:13:09 +01:00
s390_flic.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
sh_intc.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
slavio_intctl.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
spapr_xive_kvm.c ppc/xive: Rework setup of XiveSource::esb_mmio 2020-08-13 20:50:17 +10:00
spapr_xive.c ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers 2020-08-13 20:56:01 +10:00
trace-events xics: Rename misleading ics_simple_*() functions 2019-10-04 19:08:22 +10:00
vgic_common.h
xics_kvm.c error: Eliminate error_propagate() with Coccinelle, part 1 2020-07-10 15:18:08 +02:00
xics_pnv.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
xics_spapr.c spapr: Pass the maximum number of vCPUs to the KVM interrupt controller 2019-12-17 10:39:48 +11:00
xics.c error: Eliminate error_propagate() with Coccinelle, part 2 2020-07-10 15:18:08 +02:00
xilinx_intc.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xive.c ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers 2020-08-13 20:56:01 +10:00
xlnx-pmu-iomod-intc.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xlnx-zynqmp-ipi.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00