[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: |
Anthony Liguori |
Subject: |
Re: [Qemu-devel] [PATCH 02/39] dma: keep a device alive while it has SGLists |
Date: |
Fri, 07 Jun 2013 09:04:30 -0500 |
User-agent: |
Notmuch/0.15.2+77~g661dcf8 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) |
Andreas Färber <address@hidden> writes:
> 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)?
With same caveat at patch 1.
Reviewed-by: Anthony Liguori <address@hidden>
Regards,
Anthony Liguori
>
>> 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
- [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
- [Qemu-devel] [PATCH 11/39] msix: split msix_free from msix_uninit, Paolo Bonzini, 2013/06/04