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.


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