qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/8] virtio: use address_space_map/unmap to acce


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/8] virtio: use address_space_map/unmap to access descriptors
Date: Wed, 25 Jan 2017 15:04:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


On 25/01/2017 14:22, Stefan Hajnoczi wrote:
> On Tue, Jan 24, 2017 at 07:04:15PM +0100, Paolo Bonzini wrote:
>> @@ -689,18 +714,34 @@ void *virtqueue_pop(VirtQueue *vq, size_t sz)
>>      }
>>  
>>      i = head;
>> -    vring_desc_read(vdev, &desc, desc_pa, i);
>> +
>> +    len = max * sizeof(VRingDesc);
>> +    vring_desc_ptr = address_space_map(vdev->dma_as, vq->vring.desc, &len, 
>> false);
>> +    if (len < max * sizeof(VRingDesc)) {
>> +        virtio_error(vdev, "Cannot map descriptor ring");
>> +        return NULL;
> 
> Missing address_space_unmap() if vring_desc_ptr is non-NULL.
> 

Will send v3 with just

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 1b421cb..7517f7c 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -719,7 +719,7 @@ void *virtqueue_pop(VirtQueue *vq, size_t sz)
     vring_desc_ptr = address_space_map(vdev->dma_as, vq->vring.desc, &len, 
false);
     if (len < max * sizeof(VRingDesc)) {
         virtio_error(vdev, "Cannot map descriptor ring");
-        return NULL;
+        goto done;
     }
 
     desc_ptr = vring_desc_ptr;

Paolo

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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