Re: [Qemu-devel] [PATCH 12/11] virtio-pci: avoid extra pointer dereferences on fast path

2013-10-15 Thread Frederic Konrad

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 pbonz...@redhat.com
---
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)





Re: [Qemu-devel] [PATCH 12/11] virtio-pci: avoid extra pointer dereferences on fast path

2013-10-15 Thread Paolo Bonzini
Il 15/10/2013 14:13, Frederic Konrad ha scritto:
 Hi Paolo,
 
 This looks ok, but I don't find the branch where it applies?
 
 Seems it's already fixed on master.

It's on top of the previous 11 patches.

Paolo




[Qemu-devel] [PATCH 12/11] virtio-pci: avoid extra pointer dereferences on fast path

2013-10-14 Thread Paolo Bonzini
We do not need to access vdev on the MSI-X fast path of virtio_pci_notify.

Signed-off-by: Paolo Bonzini pbonz...@redhat.com
---
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)
-- 
1.8.3.1