aboutsummaryrefslogtreecommitdiff
path: root/hw/misc
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2014-08-05 13:05:57 -0600
committerAlex Williamson <alex.williamson@redhat.com>2014-08-05 13:05:57 -0600
commit9b3af4c0e40f14b5173ad6e2d9fcc376207ec1dd (patch)
tree418ff5391bf6747b80f055649b697c513ee3ed0d /hw/misc
parentc048be5cc92ae201c339d46984476c4629275ed6 (diff)
vfio: Don't cache MSIMessage
Commit 40509f7f added a test to avoid updating KVM MSI routes when the MSIMessage is unchanged and f4d45d47 switched to relying on this rather than doing our own comparison. Our cached msg is effectively unused now. Remove it. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/misc')
-rw-r--r--hw/misc/vfio.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
index e88b610721..ba08adbd99 100644
--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -132,7 +132,6 @@ typedef struct VFIOMSIVector {
EventNotifier interrupt;
EventNotifier kvm_interrupt;
struct VFIODevice *vdev; /* back pointer to device */
- MSIMessage msg; /* cache the MSI message so we know when it changes */
int virq;
bool use;
} VFIOMSIVector;
@@ -744,7 +743,6 @@ static void vfio_add_kvm_msi_virq(VFIOMSIVector *vector, MSIMessage *msg,
return;
}
- vector->msg = *msg;
vector->virq = virq;
}
@@ -760,7 +758,6 @@ static void vfio_remove_kvm_msi_virq(VFIOMSIVector *vector)
static void vfio_update_kvm_msi_virq(VFIOMSIVector *vector, MSIMessage msg)
{
kvm_irqchip_update_msi_route(kvm_state, vector->virq, msg);
- vector->msg = msg;
}
static int vfio_msix_vector_do_use(PCIDevice *pdev, unsigned int nr,
@@ -939,6 +936,7 @@ retry:
for (i = 0; i < vdev->nr_vectors; i++) {
VFIOMSIVector *vector = &vdev->msi_vectors[i];
+ MSIMessage msg = msi_get_message(&vdev->pdev, i);
vector->vdev = vdev;
vector->virq = -1;
@@ -951,13 +949,11 @@ retry:
qemu_set_fd_handler(event_notifier_get_fd(&vector->interrupt),
vfio_msi_interrupt, NULL, vector);
- vector->msg = msi_get_message(&vdev->pdev, i);
-
/*
* Attempt to enable route through KVM irqchip,
* default to userspace handling if unavailable.
*/
- vfio_add_kvm_msi_virq(vector, &vector->msg, false);
+ vfio_add_kvm_msi_virq(vector, &msg, false);
}
/* Set interrupt type prior to possible interrupts */