qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]