From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW3Vl-00012S-Ko for qemu-devel@nongnu.org; Tue, 15 Oct 2013 08:14:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW3Vd-0005gq-4e for qemu-devel@nongnu.org; Tue, 15 Oct 2013 08:14:05 -0400 Received: from [2001:41d0:8:2b42::1] (port=37321 helo=greensocs.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW3Vc-0005gL-VF for qemu-devel@nongnu.org; Tue, 15 Oct 2013 08:13:57 -0400 Message-ID: <525D3182.8090304@greensocs.com> Date: Tue, 15 Oct 2013 14:13:54 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <1379689080-32396-2-git-send-email-pbonzini@redhat.com> <1381767839-11398-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1381767839-11398-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 12/11] virtio-pci: avoid extra pointer dereferences on fast path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-stable@nongnu.org, qemu-devel@nongnu.org, mst@redhat.com 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 > --- > 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)