qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [PATCH 12/11] virtio-pci: avoid extra pointer derefere


From: Frederic Konrad
Subject: Re: [Qemu-stable] [PATCH 12/11] virtio-pci: avoid extra pointer dereferences on fast path
Date: Tue, 15 Oct 2013 14:13:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Hi Paolo,

This looks ok, but I don't find the branch where it applies?

Seems it's already fixed on master.

Thanks,
Fred

On 14/10/2013 18:23, Paolo Bonzini wrote:
We do not need to access vdev on the MSI-X fast path of virtio_pci_notify.

Signed-off-by: Paolo Bonzini <address@hidden>
---
        It is possible to get rid of BusChild altogether, but even then
        this would be one less pointer dereference, and it's a simpler
        patch.  So let's do this instead for 1.7.

  hw/virtio/virtio-pci.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 1a179ea..a191c24 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -113,12 +113,13 @@ static inline VirtIOPCIProxy 
*to_virtio_pci_proxy_fast(DeviceState *d)
  static void virtio_pci_notify(DeviceState *d, uint16_t vector)
  {
      VirtIOPCIProxy *proxy = to_virtio_pci_proxy_fast(d);
-    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
if (msix_enabled(&proxy->pci_dev))
          msix_notify(&proxy->pci_dev, vector);
-    else
+    else {
+        VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
          qemu_set_irq(proxy->pci_dev.irq[0], vdev->isr & 1);
+    }
  }
static void virtio_pci_save_config(DeviceState *d, QEMUFile *f)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]