[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/11] virtio: add MemoryListener to cache ring
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 09/11] virtio: add MemoryListener to cache ring translations |
Date: |
Mon, 12 Dec 2016 14:24:22 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Mon, Dec 12, 2016 at 12:18:55PM +0100, Paolo Bonzini wrote:
> @@ -103,6 +111,46 @@ struct VirtQueue
> QLIST_ENTRY(VirtQueue) node;
> };
>
> +static void virtio_free_region_cache(VRingMemoryRegionCaches *caches)
> +{
> + address_space_cache_destroy(&caches->desc);
> + address_space_cache_destroy(&caches->avail);
> + address_space_cache_destroy(&caches->used);
> + g_free(caches);
> +}
> +
> +static void virtio_init_region_cache(VirtIODevice *vdev, int i)
s/int i/int n/ - it seems to be the convention for virtqueue numbers.
> +{
> + VirtQueue *vq = &vdev->vq[i];
> + VRingMemoryRegionCaches *old = vq->vring.caches;
> + VRingMemoryRegionCaches *new = g_new0(VRingMemoryRegionCaches, 1);
> + hwaddr addr, size;
> + int event_size;
> +
> + event_size = virtio_vdev_has_feature(vq->vdev, VIRTIO_RING_F_EVENT_IDX)
> ? 2 : 0;
> +
> + addr = vq->vring.desc;
> + if (!addr) {
> + return;
> + }
> + size = virtio_queue_get_desc_size(vdev, i);
> + address_space_cache_init(&new->desc, &address_space_memory,
> + addr, size, false);
Missing error handling in case address_space_cache_init() fails.
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH 07/11] virtio: use address_space_map/unmap to access descriptors, (continued)
- [Qemu-devel] [PATCH 07/11] virtio: use address_space_map/unmap to access descriptors, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 01/11] exec: optimize remaining address_space_* cases, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 08/11] virtio: use MemoryRegionCache to access descriptors, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 02/11] exec: introduce memory_ldst.inc.c, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 09/11] virtio: add MemoryListener to cache ring translations, Paolo Bonzini, 2016/12/12
- Re: [Qemu-devel] [PATCH 09/11] virtio: add MemoryListener to cache ring translations,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 10/11] virtio: use VRingMemoryRegionCaches for descriptor ring, Paolo Bonzini, 2016/12/12
- [Qemu-devel] [PATCH 11/11] virtio: use VRingMemoryRegionCaches for avail and used rings, Paolo Bonzini, 2016/12/12
- Re: [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryRegionCaches, Stefan Hajnoczi, 2016/12/12
- Re: [Qemu-devel] [RFC PATCH 00/11] speedup vring processing with MemoryRegionCaches, Christian Borntraeger, 2016/12/13