diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2013-01-08 14:09:03 -0700 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2013-01-08 14:09:03 -0700 |
commit | b0223e29afdc88cc262a764026296414396cd129 (patch) | |
tree | a46b52c27406ad7192e8dba21727cb749b4f6a6a /hw/ide | |
parent | 560c30b1db1d40fe45c5104185367c4de43399d3 (diff) | |
download | qemu-b0223e29afdc88cc262a764026296414396cd129.zip qemu-b0223e29afdc88cc262a764026296414396cd129.tar.gz qemu-b0223e29afdc88cc262a764026296414396cd129.tar.bz2 |
vfio-pci: Make host MSI-X enable track guest
Guests typically enable MSI-X with all of the vectors in the MSI-X
vector table masked. Only when the vector is enabled does the vector
get unmasked, resulting in a vector_use callback. These two points,
enable and unmask, correspond to pci_enable_msix() and request_irq()
for Linux guests. Some drivers rely on VF/PF or PF/fw communication
channels that expect the physical state of the device to match the
guest visible state of the device. They don't appreciate lazily
enabling MSI-X on the physical device.
To solve this, enable MSI-X with a single vector when the MSI-X
capability is enabled and immediate disable the vector. This leaves
the physical device in exactly the same state between host and guest.
Furthermore, the brief gap where we enable vector 0, it fires into
userspace, not KVM, so the guest doesn't get spurious interrupts.
Ideally we could call VFIO_DEVICE_SET_IRQS with the right parameters
to enable MSI-X with zero vectors, but this will currently return an
error as the Linux MSI-X interfaces do not allow it.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-stable@nongnu.org
Diffstat (limited to 'hw/ide')
0 files changed, 0 insertions, 0 deletions