vfio: QEMU-AER: Qemu changes to support AER for VFIO-PCI devices
commit7b4b0e9eda51902b53bc1a2318df53cdb8b72eed
authorVijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com>
Mon, 15 Jul 2013 21:49:49 +0000 (15 15:49 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 15 Jul 2013 21:49:49 +0000 (15 15:49 -0600)
tree41f0e4c73764b63715910d628ade456a352afe22
parent39360f0b91d38790b5756d621ca9a7dd93ca8816
vfio: QEMU-AER: Qemu changes to support AER for VFIO-PCI devices

Add support for error containment when a VFIO device assigned to a KVM
guest encounters an error. This is for PCIe devices/drivers that support AER
functionality. When the host OS is notified of an error in a device either
through the firmware first approach or through an interrupt handled by the AER
root port driver, the error handler registered by the vfio-pci driver gets
invoked. The qemu process is signaled through an eventfd registered per
VFIO device by the qemu process. In the eventfd handler, qemu decides on
what action to take. In this implementation, guest is brought down to
contain the error.

The kernel patches for the above functionality has been already accepted.

This is a refresh of the QEMU patch which was reviewed earlier.
http://marc.info/?l=linux-kernel&m=136281557608087&w=2
This patch has the same contents and has been built after refreshing
to latest upstream and after the linux headers have been updated in qemu.

- Create eventfd per vfio device assigned to a guest and register an
          event handler

- This fd is passed to the vfio_pci driver through the SET_IRQ ioctl

- When the device encounters an error, the eventfd is signalled
          and the qemu eventfd handler gets invoked.

- In the handler decide what action to take. Current action taken
          is to stop the guest.

Signed-off-by: Vijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/misc/vfio.c