qemu-e2k/hw/xen
Paul Durrant 32d0b7be68 xen-bus/block: explicitly assign event channels to an AioContext
It is not safe to close an event channel from the QEMU main thread when
that channel's poller is running in IOThread context.

This patch adds a new xen_device_set_event_channel_context() function
to explicitly assign the channel AioContext, and modifies
xen_device_bind_event_channel() to initially assign the channel's poller
to the QEMU main thread context. The code in xen-block's dataplane is
then modified to assign the channel to IOThread context during
xen_block_dataplane_start() and de-assign it during in
xen_block_dataplane_stop(), such that the channel is always assigned
back to main thread context before it is closed. aio_set_fd_handler()
already deals with all the necessary synchronization when moving an fd
between AioContext-s so no extra code is needed to manage this.

Reported-by: Julien Grall <jgrall@amazon.com>
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20191216143451.19024-1-pdurrant@amazon.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2020-02-27 11:50:30 +00:00
..
Makefile.objs
trace-events xen: perform XenDevice clean-up in XenBus watch handler 2019-09-24 12:18:47 +01:00
xen_devconfig.c
xen_pt_config_init.c
xen_pt_graphics.c Avoid cpu_physical_memory_rw() with a constant is_write argument 2020-02-20 14:47:08 +01:00
xen_pt_load_rom.c hw/xen/xen_pt_load_rom: Remove unused includes 2020-02-27 11:50:30 +00:00
xen_pt_msi.c
xen_pt.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xen_pt.h
xen_pvdev.c
xen-backend.c
xen-bus-helper.c
xen-bus.c xen-bus/block: explicitly assign event channels to an AioContext 2020-02-27 11:50:30 +00:00
xen-common.c xen: convert "-machine igd-passthru" to an accelerator property 2019-12-17 19:32:27 +01:00
xen-host-pci-device.c
xen-host-pci-device.h
xen-legacy-backend.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00