From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkrRy-0007Pa-7E for qemu-devel@nongnu.org; Fri, 07 Jun 2013 03:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkrRw-0008Ak-3G for qemu-devel@nongnu.org; Fri, 07 Jun 2013 03:51:06 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41619 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkrRv-0008AW-SV for qemu-devel@nongnu.org; Fri, 07 Jun 2013 03:51:03 -0400 Message-ID: <51B190E2.7020803@suse.de> Date: Fri, 07 Jun 2013 09:50:58 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1370371954-8479-1-git-send-email-pbonzini@redhat.com> <1370371954-8479-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1370371954-8479-3-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/39] dma: keep a device alive while it has SGLists List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com Am 04.06.2013 20:51, schrieb Paolo Bonzini: > A QEMUSGList has a reference to a device's address space. Keep > the device alive while the QEMUSGList exists. >=20 > Signed-off-by: Paolo Bonzini > --- > dma-helpers.c | 6 +++++- > hw/ide/ahci.c | 3 ++- > hw/ide/macio.c | 4 ++-- > hw/scsi/megasas.c | 4 ++-- > hw/scsi/virtio-scsi.c | 10 ++++++---- > hw/usb/hcd-ehci.c | 4 ++-- > include/hw/pci/pci.h | 2 +- > include/sysemu/dma.h | 4 +++- > 8 files changed, 23 insertions(+), 14 deletions(-) [...] > diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c > index 7ee7d97..65ccb09 100644 > --- a/hw/scsi/megasas.c > +++ b/hw/scsi/megasas.c > @@ -232,7 +232,7 @@ static int megasas_map_sgl(MegasasState *s, Megasas= Cmd *cmd, union mfi_sgl *sgl) > MEGASAS_MAX_SGE); > return iov_count; > } > - qemu_sglist_init(&cmd->qsg, iov_count, pci_get_address_space(&s->d= ev)); > + pci_dma_sglist_init(&cmd->qsg, &s->dev, iov_count); PCI_DEVICE(s)? > for (i =3D 0; i < iov_count; i++) { > dma_addr_t iov_pa, iov_size_p; > =20 > @@ -628,7 +628,7 @@ static int megasas_map_dcmd(MegasasState *s, Megasa= sCmd *cmd) > } > iov_pa =3D megasas_sgl_get_addr(cmd, &cmd->frame->dcmd.sgl); > iov_size =3D megasas_sgl_get_len(cmd, &cmd->frame->dcmd.sgl); > - qemu_sglist_init(&cmd->qsg, 1, pci_get_address_space(&s->dev)); > + pci_dma_sglist_init(&cmd->qsg, &s->dev, 1); Ditto? > qemu_sglist_add(&cmd->qsg, iov_pa, iov_size); > cmd->iov_size =3D iov_size; > return cmd->iov_size; [snip] Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg