qemu-e2k/include/hw
Milan Zamazal 63a3520e29 hw/virtio: Add a protection against duplicate vu_scmi_stop calls
The QEMU CI fails in virtio-scmi test occasionally.  As reported by
Thomas Huth, this happens most likely when the system is loaded and it
fails with the following error:

  qemu-system-aarch64: ../../devel/qemu/hw/pci/msix.c:659:
  msix_unset_vector_notifiers: Assertion `dev->msix_vector_use_notifier && dev->msix_vector_release_notifier' failed.
  ../../devel/qemu/tests/qtest/libqtest.c:200: kill_qemu() detected QEMU death from signal 6 (Aborted) (core dumped)

As discovered by Fabiano Rosas, the cause is a duplicate invocation of
msix_unset_vector_notifiers via duplicate vu_scmi_stop calls:

  msix_unset_vector_notifiers
  virtio_pci_set_guest_notifiers
  vu_scmi_stop
  vu_scmi_disconnect
  ...
  qemu_chr_write_buffer

  msix_unset_vector_notifiers
  virtio_pci_set_guest_notifiers
  vu_scmi_stop
  vu_scmi_set_status
  ...
  qemu_cleanup

While vu_scmi_stop calls are protected by vhost_dev_is_started()
check, it's apparently not enough.  vhost-user-blk and vhost-user-gpio
use an extra protection, see f5b22d06fb (vhost: recheck dev state in
the vhost_migration_log routine) for the motivation.  Let's use the
same in vhost-user-scmi, which fixes the failure above.

Fixes: a5dab090e1 ("hw/virtio: Add boilerplate for vhost-user-scmi device")
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Message-Id: <20230720101037.2161450-1-mzamazal@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
2023-08-03 16:06:49 -04:00
..
acpi
adc
arm arm: spelling fixes 2023-07-25 17:13:53 +03:00
audio
block
char escc: emulate dip switch language layout settings on SUN keyboard 2023-06-28 10:54:25 +01:00
core plugins: force slow path when plugins instrument memory ops 2023-07-03 12:51:58 +01:00
cpu
cris
cxl hw/cxl/events: Add injection of Memory Module Events 2023-06-23 02:54:40 -04:00
display
dma
firmware
gpio
hyperv
i2c
i386 hw/i386/pc: Remove PC_MACHINE_DEVMEM_REGION_SIZE 2023-07-12 09:25:37 +02:00
ide hw/ide: Extract bmdma_status_writeb() 2023-07-11 00:11:25 +02:00
input
intc arm: spelling fixes 2023-07-25 17:13:53 +03:00
ipack
ipmi
isa hw/isa/vt82c686: Remove via_isa_set_irq() 2023-07-11 00:11:25 +02:00
kvm
loongarch
m68k q800: move macfb device to Q800MachineState 2023-06-22 09:30:11 +02:00
mem
mips
misc hw/misc: sifive_e_aon: Support the watchdog timer of HiFive 1 rev b. 2023-07-10 22:29:14 +10:00
net hw/net/dp8393x.c: move TYPE_DP8393X and dp8393xState into dp8393x.h 2023-06-22 09:25:40 +02:00
nubus
nvram
openrisc
pci pcie: Specify 0 for ARI next function numbers 2023-07-10 18:59:32 -04:00
pci-bridge
pci-host hw/pci-host/i440fx: Resolve i440fx_init() 2023-07-10 16:29:17 -04:00
ppc ppc/pnv: Add QME region for P10 2023-07-07 06:32:53 -03:00
rdma
remote
riscv hw/riscv: sifive_e: Support the watchdog timer of HiFive 1 rev b. 2023-07-10 22:29:15 +10:00
rtc
rx
s390x s390x: spelling fixes 2023-07-25 17:13:45 +03:00
scsi scsi: fetch unit attention when creating the request 2023-07-14 11:10:58 +02:00
sd hw: sd: allwinner-sdhost: Add sun50i-a64 SoC support 2023-06-06 10:19:33 +01:00
sensor
sh4
southbridge hw/isa/piix3: Resolve redundant TYPE_PIIX3_XEN_DEVICE 2023-06-07 15:07:10 +01:00
sparc
ssi
timer
tricore
usb
vfio vfio/migration: Return bool type for vfio_migration_realize() 2023-07-10 09:52:52 +02:00
virtio hw/virtio: Add a protection against duplicate vu_scmi_stop calls 2023-08-03 16:06:49 -04:00
watchdog
xen xen: Don't pass MemoryListener around by value 2023-08-01 10:22:33 +01:00
xtensa
boards.h memory-device: Track used region size in DeviceMemoryState 2023-07-12 09:25:37 +02:00
clock.h
elf_ops.h
fw-path-provider.h
hotplug.h
hw.h
ide.h
irq.h
loader-fit.h
loader.h
nmi.h
or-irq.h
pcmcia.h
platform-bus.h
ptimer.h
qdev-clock.h
qdev-core.h include/hw: document the device_class_set_parent_* fns 2023-07-10 18:59:32 -04:00
qdev-dma.h
qdev-properties-system.h
qdev-properties.h
register.h
registerfields.h
resettable.h
stream.h
sysbus.h
usb.h
vmstate-if.h