qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/11] virtio: use MemoryRegionCache to access d


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 08/11] virtio: use MemoryRegionCache to access descriptors
Date: Mon, 12 Dec 2016 14:17:28 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

On Mon, Dec 12, 2016 at 12:18:54PM +0100, Paolo Bonzini wrote:
> @@ -430,41 +431,42 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned 
> int *in_bytes,
>                                 unsigned int *out_bytes,
>                                 unsigned max_in_bytes, unsigned max_out_bytes)
>  {
> -    unsigned int idx;
> +    VirtIODevice *vdev = vq->vdev;
> +    unsigned int max, idx;
>      unsigned int total_bufs, in_total, out_total;
> -    void *desc_ptr = NULL;
> -    hwaddr len = 0;
> +    MemoryRegionCache *desc_cache = NULL;
> +    MemoryRegionCache vring_desc_cache;
> +    MemoryRegionCache indirect_desc_cache;
> +    int64_t len = 0;
>      int rc;
>  
> +    rcu_read_lock();

Please document the purpose of the rcu_read_lock() in virtio code.

Also, do the goto err cases call rcu_read_unlock()?

Attachment: signature.asc
Description: PGP signature


reply via email to

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