7 struct v3_guest_mem_block {
8 void *gpa; // guest physical address is
9 void *hpa; // mapped to this host physical address
10 void *uva; // which is mapped here in this process
11 uint64_t numpages; // this many 4K pages
14 // Whole memory map of guest's physical memory
15 // that is backed by host physical memory (ie, everything we
16 // can read or write from the host user space)
17 struct v3_guest_mem_map {
18 int fd; // used by mmap
20 struct v3_guest_mem_block block[0];
23 // This function gets the basic memory map, but does not map it
24 struct v3_guest_mem_map * v3_guest_mem_get_map(char *vmdev);
25 // This function mmaps it into the guest address space
26 // and fills out the "myaddr" fields
27 int v3_map_guest_mem(struct v3_guest_mem_map *map);
28 // This function unmaps it - it assumes myaddrs are valid
29 int v3_unmap_guest_mem(struct v3_guest_mem_map *map);