Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


bc1a2886d302f3fafa3e3fdf4d74a919315df781
[palacios.git] / palacios / include / palacios / vm_guest_mem.h
1 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
3
4 #ifndef __VM_GUEST_MEM_H
5 #define __VM_GUEST_MEM_H
6
7
8 #ifdef __V3VEE__
9
10 #include <palacios/vm_guest.h>
11 #include <palacios/vmm_mem.h>
12
13
14 /* These functions are ordered such that they can only call the functions defined in a lower order group */
15 /* This is to avoid infinite lookup loops */
16
17 /**********************************/
18 /* GROUP 0                        */
19 /**********************************/
20
21 /* Fundamental converters */
22 // Call out to OS
23 int host_va_to_host_pa(addr_t host_va, addr_t * host_pa);
24 int host_pa_to_host_va(addr_t host_pa, addr_t * host_va);
25
26 // guest_pa -> (shadow map) -> host_pa
27 int guest_pa_to_host_pa(struct guest_info * guest_info, addr_t guest_pa, addr_t * host_pa);
28
29 /* !! Currently not implemented !! */
30 // host_pa -> (shadow_map) -> guest_pa
31 int host_pa_to_guest_pa(struct guest_info * guest_info, addr_t host_pa, addr_t * guest_pa);
32
33
34 /**********************************/
35 /* GROUP 1                        */
36 /**********************************/
37
38
39 /* !! Currently not implemented !! */
40 // host_va -> host_pa -> guest_pa
41 int host_va_to_guest_pa(struct guest_info * guest_info, addr_t host_va, addr_t * guest_pa);
42
43
44 // guest_pa -> host_pa -> host_va
45 int guest_pa_to_host_va(struct guest_info * guest_info, addr_t guest_pa, addr_t * host_va);
46
47
48 // Look up the address in the guests page tables.. This can cause multiple calls that translate
49 //     ------------------------------------------------
50 //     |                                              |
51 //     -->   guest_pa -> host_pa -> host_va ->   (read table) --> guest_pa
52 int guest_va_to_guest_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * guest_pa);
53
54
55
56 /* !! Currently not implemented !! */
57 //   A page table walker in the guest's address space
58 //     ------------------------------------------------
59 //     |                                              |
60 //     -->   guest_pa -> host_pa -> host_va ->   (read table) --> guest_va
61 int guest_pa_to_guest_va(struct guest_info * guest_info, addr_t guest_pa, addr_t * guest_va);
62
63
64
65 /**********************************/
66 /* GROUP 2                        */
67 /**********************************/
68 // guest_va -> guest_pa -> host_pa
69 int guest_va_to_host_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * host_pa);
70
71
72 /* !! Currently not implemented !! */
73 // host_pa -> guest_pa -> guest_va
74 int host_pa_to_guest_va(struct guest_info * guest_info, addr_t host_pa, addr_t * guest_va);
75
76 // guest_va -> guest_pa -> host_pa -> host_va
77 int guest_va_to_host_va(struct guest_info * guest_info, addr_t guest_va, addr_t * host_va);
78
79
80 /* !! Currently not implemented !! */
81 // host_va -> host_pa -> guest_pa -> guest_va
82 int host_va_to_guest_va(struct guest_info * guest_info, addr_t host_va, addr_t  * guest_va);
83
84
85
86
87
88
89
90
91
92 int read_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, char * dest);
93 int read_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int count, char * dest);
94 int write_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int count, char * src);
95 // TODO int write_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, char * src);
96
97
98 #endif // ! __V3VEE__
99
100
101 #endif