qemu-patch-raspberry4/hw
Greg Kurz 38298611d5 xics/kvm: Always set the MASKED bit if interrupt is masked
The ics_set_kvm_state_one() function is called either to restore the
state of an interrupt source during migration or to set the interrupt
source to a default state during reset.

Since always, ie. 2013, the code only sets the MASKED bit if the 'current
priority' and the 'saved priority' are different. This is likely true
when restoring an interrupt that had been previously masked with the
ibm,int-off RTAS call. However this is always false in the case of
reset since both 'current priority' and 'saved priority' are equal to
0xff, and the MASKED bit is never set.

The legacy KVM XICS device gets away with that because it ends updating
its internal structure the same way, whether the MASKED bit is set or
the priority is 0xff.

The XICS-on-XIVE device for POWER9 is different. It sticks to the KVM
documentation [1] and _really_ relies on the MASKED bit to correctly
set. If not, it will configure the interrupt source in the XIVE HW, even
though the guest hasn't configured the interrupt yet. This disturbs the
complex logic implemented in XICS-on-XIVE and may result in the loss of
subsequent queued events.

Always set the MASKED bit if interrupt is masked as expected by the KVM
XICS-on-XIVE device. This has no impact on the legacy KVM XICS.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/virtual/kvm/devices/xics.txt

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <156217454083.559957.7359208229523652842.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-12 15:50:00 +10:00
..
9pfs xen: Import other xen/io/*.h 2019-06-24 10:42:30 +01:00
acpi hw/acpi: extract acpi_add_rom_blob() 2019-06-16 16:16:52 -04:00
adc Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
alpha hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
arm hw/arm/sbsa-ref: Remove unnecessary check for secure_sysmem == NULL 2019-07-08 14:11:31 +01:00
audio Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
block Revert "hw/block/pflash_cfi02: Reduce I/O accesses to 16-bit" 2019-07-09 17:14:39 +02:00
bt Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
char xen: Import other xen/io/*.h 2019-06-24 10:42:30 +01:00
core qdev: add qdev_add_vm_change_state_handler() 2019-07-08 16:00:26 +02:00
cpu general: Replace global smp variables with smp machine properties 2019-07-05 17:07:36 -03:00
cris Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
display ati-vga: Fix setting offset together with pitch for r128pro 2019-07-05 09:50:33 +02:00
dma dma/rc4030: Minor code style cleanup 2019-06-26 13:25:07 +02:00
gpio Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
hppa hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
hyperv Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
i2c hw/i2c/bitbang_i2c: Use in-place rather than malloc'd bitbang_i2c_interface struct 2019-07-03 10:51:35 +02:00
i386 Bugfixes. 2019-07-08 10:26:18 +01:00
ide Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
input Supply missing header guards 2019-06-12 13:20:21 +02:00
intc xics/kvm: Always set the MASKED bit if interrupt is masked 2019-07-12 15:50:00 +10:00
ipack Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
ipmi Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
isa Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
lm32 Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
m68k Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
mem Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
microblaze Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
mips hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
misc hw/misc/aspeed_xdma: New device 2019-07-01 17:29:00 +01:00
moxie Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
net sunhme: ensure that RX descriptor ring overflow is indicated to client driver 2019-07-02 22:49:08 +01:00
nios2 Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
nvram Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
openrisc hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
pci pcie: minor cleanups for slot control/status 2019-07-01 09:17:30 -04:00
pci-bridge pcie: check that slt ctrl changed before deleting 2019-07-01 09:17:30 -04:00
pci-host i.mx7d: pci: Update PCI IRQ mapping to match HW 2019-07-01 17:28:59 +01:00
pcmcia Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
ppc machine: show if CLI option '-numa node,mem' is supported in QAPI schema 2019-07-05 17:08:03 -03:00
rdma Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
riscv hw/riscv: Replace global smp variables with machine smp properties 2019-07-05 17:07:42 -03:00
s390x hw/s390x: Replace global smp variables with machine smp properties 2019-07-05 17:08:03 -03:00
scsi virtio-scsi: restart DMA after iothread 2019-07-08 16:00:26 +02:00
sd sd: Fix out-of-bounds assertions 2019-06-21 13:25:29 +02:00
semihosting semihosting: split console_out into string and char versions 2019-06-12 17:53:22 +01:00
sh4 Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
smbios machine: Refactor smp-related call chains to pass MachineState 2019-07-05 17:07:36 -03:00
sparc hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
sparc64 hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
ssi aspeed/smc: add a 'sdram_base' property 2019-07-01 17:28:59 +01:00
timer hw/timer/armv7m_systick: Forbid non-privileged accesses 2019-07-04 17:25:30 +01:00
tpm hw/tpm: Only build tpm_ppi.o if any of TPM_TIS/TPM_CRB is built 2019-07-08 10:04:38 -04:00
tricore Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
unicore32 target/unicore32: Use env_cpu, env_archcpu 2019-06-10 07:03:42 -07:00
usb xen: Import other xen/io/*.h 2019-06-24 10:42:30 +01:00
vfio vfio-ccw: Test vfio_set_irq_signaling() return value 2019-07-08 12:10:37 +02:00
virtio virtio-scsi: restart DMA after iothread 2019-07-08 16:00:26 +02:00
watchdog aspeed: Link SCU to the watchdog 2019-07-01 17:29:00 +01:00
xen xen: Import other xen/io/*.h 2019-06-24 10:42:30 +01:00
xenpv xen: Replace few mentions of xend by libxl 2019-01-14 13:45:40 +00:00
xtensa hw: Replace global smp variables with MachineState for all remaining archs 2019-07-05 17:08:03 -03:00
Kconfig semihosting: introduce CONFIG_SEMIHOSTING 2019-05-28 10:28:50 +01:00
Makefile.objs semihosting: move semihosting configuration into its own directory 2019-05-28 10:28:50 +01:00