1 #ifndef __VM_GUEST_MEM_H
2 #define __VM_GUEST_MEM_H
4 #include <palacios/vm_guest.h>
5 #include <palacios/vmm_mem.h>
8 /* These functions are ordered such that they can only call the functions defined in a lower order group */
9 /* This is to avoid infinite lookup loops */
11 /**********************************/
13 /**********************************/
15 /* Fundamental converters */
17 int host_va_to_host_pa(addr_t host_va, addr_t * host_pa);
18 int host_pa_to_host_va(addr_t host_pa, addr_t * host_va);
20 // guest_pa -> (shadow map) -> host_pa
21 int guest_pa_to_host_pa(struct guest_info * guest_info, addr_t guest_pa, addr_t * host_pa);
23 /* !! Currently not implemented !! */
24 // host_pa -> (shadow_map) -> guest_pa
25 int host_pa_to_guest_pa(struct guest_info * guest_info, addr_t host_pa, addr_t * guest_pa);
28 /**********************************/
30 /**********************************/
33 /* !! Currently not implemented !! */
34 // host_va -> host_pa -> guest_pa
35 int host_va_to_guest_pa(struct guest_info * guest_info, addr_t host_va, addr_t * guest_pa);
38 // guest_pa -> host_pa -> host_va
39 int guest_pa_to_host_va(struct guest_info * guest_info, addr_t guest_pa, addr_t * host_va);
42 // Look up the address in the guests page tables.. This can cause multiple calls that translate
43 // ------------------------------------------------
45 // --> guest_pa -> host_pa -> host_va -> (read table) --> guest_pa
46 int guest_va_to_guest_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * guest_pa);
50 /* !! Currently not implemented !! */
51 // A page table walker in the guest's address space
52 // ------------------------------------------------
54 // --> guest_pa -> host_pa -> host_va -> (read table) --> guest_va
55 int guest_pa_to_guest_va(struct guest_info * guest_info, addr_t guest_pa, addr_t * guest_va);
59 /**********************************/
61 /**********************************/
62 // guest_va -> guest_pa -> host_pa
63 int guest_va_to_host_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * host_pa);
66 /* !! Currently not implemented !! */
67 // host_pa -> guest_pa -> guest_va
68 int host_pa_to_guest_va(struct guest_info * guest_info, addr_t host_pa, addr_t * guest_va);
70 // guest_va -> guest_pa -> host_pa -> host_va
71 int guest_va_to_host_va(struct guest_info * guest_info, addr_t guest_va, addr_t * host_va);
74 /* !! Currently not implemented !! */
75 // host_va -> host_pa -> guest_pa -> guest_va
76 int host_va_to_guest_va(struct guest_info * guest_info, addr_t host_va, addr_t * guest_va);
86 int read_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, char * dest);
87 int read_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int count, char * dest);
88 int write_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int count, char * src);
89 // TODO int write_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, char * src);