qemu/include
Steve Sistare 322ee16824 vfio/pci: preserve pending interrupts
cpr-transfer may lose a VFIO interrupt because the KVM instance is
destroyed and recreated.  If an interrupt arrives in the middle, it is
dropped.  To fix, stop pending new interrupts during cpr save, and pick
up the pieces.  In more detail:

Stop the VCPUs. Call kvm_irqchip_remove_irqfd_notifier_gsi --> KVM_IRQFD to
deassign the irqfd gsi that routes interrupts directly to the VCPU and KVM.
After this call, interrupts fall back to the kernel vfio_msihandler, which
writes to QEMU's kvm_interrupt eventfd.  CPR already preserves that
eventfd.  When the route is re-established in new QEMU, the kernel tests
the eventfd and injects an interrupt to KVM if necessary.

Deassign INTx in a similar manner.  For both MSI and INTx, remove the
eventfd handler so old QEMU does not consume an event.

If an interrupt was already pended to KVM prior to the completion of
kvm_irqchip_remove_irqfd_notifier_gsi, it will be recovered by the
subsequent call to cpu_synchronize_all_states, which pulls KVM interrupt
state to userland prior to saving it in vmstate.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Link: https://lore.kernel.org/qemu-devel/1752689169-233452-3-git-send-email-steven.sistare@oracle.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2025-08-09 00:06:48 +02:00
..
accel accel/system: Introduce @x-accel-stats QMP command 2025-07-15 19:34:33 +02:00
authz
block blockjob: mark block_job_remove_all_bdrv() as GRAPH_UNLOCKED 2025-07-14 15:42:28 +02:00
chardev chardev/char-hub: implement backend chardev aggregator 2025-02-03 13:57:08 +04:00
crypto crypto: implement workaround for GNUTLS thread safety problems 2025-07-22 19:39:29 -03:00
disas disas: Fix build against Capstone v6 (again) 2024-11-05 10:09:59 +00:00
exec qemu: Declare all load/store helper in 'qemu/bswap.h' 2025-07-15 02:56:39 -04:00
fpu fpu: Move m68k_denormal fmt flag into floatx80_behaviour 2025-02-25 15:32:57 +00:00
gdbstub gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian() 2025-07-15 02:56:39 -04:00
hw vfio/pci: preserve pending interrupts 2025-08-09 00:06:48 +02:00
io io: add support for activating TLS thread safety workaround 2025-07-22 19:39:30 -03:00
libdecnumber include/libdecnumber: replace FSF postal address with licenses URL 2025-06-26 00:42:37 +02:00
migration migration: Rename save_live_complete_precopy_thread to save_complete_precopy_thread 2025-07-11 10:37:39 -03:00
monitor monitor: Remove obsolete stubs 2024-06-30 19:51:44 +03:00
net virtio,pci,pc: features, fixes, tests 2025-07-16 07:00:47 -04:00
qapi util/error: make func optional 2025-06-05 20:24:51 +02:00
qemu host-utils: Drop workaround for buggy Apple Clang __builtin_subcll() 2025-07-21 10:07:53 +01:00
qobject qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qom qom: reverse order of instance_post_init calls 2025-05-20 08:18:53 +02:00
scsi hw/ufs: Support for UFS logical unit 2023-09-07 14:01:29 -04:00
semihosting semihosting/uaccess: Remove uses of target_ulong type 2025-07-02 10:09:48 +01:00
standard-headers update Linux headers to v6.16-rc3 2025-06-20 13:25:59 +02:00
system Accelerators patches 2025-07-16 07:13:40 -04:00
tcg accel/tcg: Propagate AccelState to dump_accel_info() 2025-07-15 19:34:33 +02:00
ui ui/gtk: Add scale option 2025-07-15 10:22:33 +04:00
user qemu: Declare all load/store helper in 'qemu/bswap.h' 2025-07-15 02:56:39 -04:00
elf.h
glib-compat.h include/glib-compat.h: Poison g_list_sort and g_slist_sort 2025-05-06 16:02:04 +02:00
qemu-io.h
qemu-main.h ui & main loop: Redesign of system-specific main thread event handling 2024-12-31 21:21:34 +01:00