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.


3b7ec2e3ce16972900898527b927ffd8e6ca8560
[palacios.git] / palacios / include / palacios / vm_guest_mem.h
1 #ifndef __VM_GUEST_MEM_H
2 #define __VM_GUEST_MEM_H
3
4 #include <palacios/vm_guest.h>
5 #include <palacios/vmm_mem.h>
6
7
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 */
10
11 /**********************************/
12 /* GROUP 0                        */
13 /**********************************/
14
15 /* Fundamental converters */
16 // Call out to OS
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);
19
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);
22
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);
26
27
28 /**********************************/
29 /* GROUP 1                        */
30 /**********************************/
31
32
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);
36
37
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);
40
41
42 // Look up the address in the guests page tables.. This can cause multiple calls that translate
43 //     ------------------------------------------------
44 //     |                                              |
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);
47
48
49
50 /* !! Currently not implemented !! */
51 //   A page table walker in the guest's address space
52 //     ------------------------------------------------
53 //     |                                              |
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);
56
57
58
59 /**********************************/
60 /* GROUP 2                        */
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);
64
65
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);
69
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);
72
73
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);
77
78
79
80
81
82
83
84
85
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);
90
91
92
93
94
95 #endif