virtio: use MemoryRegionCache to access descriptors

For now, the cache is created on every virtqueue_pop.  Later on,
direct descriptors will be able to reuse it.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Paolo Bonzini 2017-01-27 16:40:16 +01:00 committed by Michael S. Tsirkin
parent 91047df38d
commit 5eba0404b9
2 changed files with 41 additions and 41 deletions

View file

@ -1426,6 +1426,8 @@ struct MemoryRegionCache {
bool is_write;
};
#define MEMORY_REGION_CACHE_INVALID ((MemoryRegionCache) { .mr = NULL })
/* address_space_cache_init: prepare for repeated access to a physical
* memory region
*