OpenCloudOS-Kernel/drivers/virtio
Michael S. Tsirkin e6af578c53 virtio-pci: make reset operation safer
virtio pci device reset actually just does an I/O
write, which in PCI is really posted, that is it
can complete on CPU before the device has received it.

Further, interrupts might have been pending on
another CPU, so device callback might get invoked after reset.

This conflicts with how drivers use reset, which is typically:
	reset
	unregister
a callback running after reset completed can race with
unregister, potentially leading to use after free bugs.

Fix by flushing out the write, and flushing pending interrupts.

This assumes that device is never reset from
its vq/config callbacks, or in parallel with being
added/removed, document this assumption.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-11-24 13:04:48 +10:30
..
Kconfig virtio: add HAS_IOMEM dependency to MMIO platform bus driver 2011-11-24 13:04:47 +10:30
Makefile virtio: Add platform bus driver for memory mapped virtio device 2011-11-02 11:41:01 +10:30
config.c Virtio interface 2007-10-23 15:49:54 +10:00
virtio.c virtio: Add module.h to drivers/virtio users. 2011-10-31 19:32:14 -04:00
virtio_balloon.c virtio: Add module.h to drivers/virtio users. 2011-10-31 19:32:14 -04:00
virtio_mmio.c virtio-mmio: Correct the name of the guest features selector 2011-11-24 13:04:47 +10:30
virtio_pci.c virtio-pci: make reset operation safer 2011-11-24 13:04:48 +10:30
virtio_ring.c virtio: Add module.h to drivers/virtio users. 2011-10-31 19:32:14 -04:00