[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/39] dma: keep a device alive while it has SGL
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 02/39] dma: keep a device alive while it has SGLists |
Date: |
Fri, 07 Jun 2013 09:50:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
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.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> 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, MegasasCmd
> *cmd, union mfi_sgl *sgl)
> MEGASAS_MAX_SGE);
> return iov_count;
> }
> - qemu_sglist_init(&cmd->qsg, iov_count, pci_get_address_space(&s->dev));
> + pci_dma_sglist_init(&cmd->qsg, &s->dev, iov_count);
PCI_DEVICE(s)?
> for (i = 0; i < iov_count; i++) {
> dma_addr_t iov_pa, iov_size_p;
>
> @@ -628,7 +628,7 @@ static int megasas_map_dcmd(MegasasState *s, MegasasCmd
> *cmd)
> }
> iov_pa = megasas_sgl_get_addr(cmd, &cmd->frame->dcmd.sgl);
> iov_size = 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 = iov_size;
> return cmd->iov_size;
[snip]
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 01/39] scsi: keep device alive while it has requests, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 02/39] dma: keep a device alive while it has SGLists, Paolo Bonzini, 2013/06/04
- Re: [Qemu-devel] [PATCH 02/39] dma: keep a device alive while it has SGLists,
Andreas Färber <=
- [Qemu-devel] [PATCH 03/39] pci: split exit and finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 04/39] ac97: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 05/39] es1370: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 06/39] hda: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 07/39] serial: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 08/39] tpci200: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 09/39] pci-assign: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 10/39] ahci: split exit and instance_finalize, Paolo Bonzini, 2013/06/04