]> git.proxmox.com Git - qemu.git/commit
dataplane: add host memory mapping code
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 20 Nov 2012 09:30:08 +0000 (10:30 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 2 Jan 2013 14:50:32 +0000 (15:50 +0100)
commit185ecf40e3589fc2717b0856ee1df05dd63a46dd
treefeee51d156bbb7576bd26de6f2dc8ccff96c6061
parent583f6e7bbd24b31f7eecd5c21ba0a5a5a77f52f1
dataplane: add host memory mapping code

The data plane thread needs to map guest physical addresses to host
pointers.  Normally this is done with cpu_physical_memory_map() but the
function assumes the global mutex is held.  The data plane thread does
not touch the global mutex and therefore needs a thread-safe memory
mapping mechanism.

Hostmem registers a MemoryListener similar to how vhost collects and
pushes memory region information into the kernel.  There is a
fine-grained lock on the regions list which is held during lookup and
when installing a new regions list.

When the physical memory map changes the MemoryListener callbacks are
invoked.  They build up a new list of memory regions which is finally
installed when the list has been completed.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/Makefile.objs
hw/dataplane/Makefile.objs [new file with mode: 0644]
hw/dataplane/hostmem.c [new file with mode: 0644]
hw/dataplane/hostmem.h [new file with mode: 0644]