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.


Release 1.0
[palacios.git] / palacios / include / palacios / vm_guest_mem.h
1 /*
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #ifndef __VM_GUEST_MEM_H
21 #define __VM_GUEST_MEM_H
22
23
24 #ifdef __V3VEE__
25
26 #include <palacios/vm_guest.h>
27 #include <palacios/vmm_mem.h>
28
29
30 /* These functions are ordered such that they can only call the functions defined in a lower order group */
31 /* This is to avoid infinite lookup loops */
32
33 /**********************************/
34 /* GROUP 0                        */
35 /**********************************/
36
37 /* Fundamental converters */
38 // Call out to OS
39 int host_va_to_host_pa(addr_t host_va, addr_t * host_pa);
40 int host_pa_to_host_va(addr_t host_pa, addr_t * host_va);
41
42 // guest_pa -> (shadow map) -> host_pa
43 int guest_pa_to_host_pa(struct guest_info * guest_info, addr_t guest_pa, addr_t * host_pa);
44
45 /* !! Currently not implemented !! */
46 // host_pa -> (shadow_map) -> guest_pa
47 int host_pa_to_guest_pa(struct guest_info * guest_info, addr_t host_pa, addr_t * guest_pa);
48
49
50 /**********************************/
51 /* GROUP 1                        */
52 /**********************************/
53
54
55 /* !! Currently not implemented !! */
56 // host_va -> host_pa -> guest_pa
57 int host_va_to_guest_pa(struct guest_info * guest_info, addr_t host_va, addr_t * guest_pa);
58
59
60 // guest_pa -> host_pa -> host_va
61 int guest_pa_to_host_va(struct guest_info * guest_info, addr_t guest_pa, addr_t * host_va);
62
63
64 // Look up the address in the guests page tables.. This can cause multiple calls that translate
65 //     ------------------------------------------------
66 //     |                                              |
67 //     -->   guest_pa -> host_pa -> host_va ->   (read table) --> guest_pa
68 int guest_va_to_guest_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * guest_pa);
69
70
71
72 /* !! Currently not implemented !! */
73 //   A page table walker in the guest's address space
74 //     ------------------------------------------------
75 //     |                                              |
76 //     -->   guest_pa -> host_pa -> host_va ->   (read table) --> guest_va
77 int guest_pa_to_guest_va(struct guest_info * guest_info, addr_t guest_pa, addr_t * guest_va);
78
79
80
81 /**********************************/
82 /* GROUP 2                        */
83 /**********************************/
84 // guest_va -> guest_pa -> host_pa
85 int guest_va_to_host_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * host_pa);
86
87
88 /* !! Currently not implemented !! */
89 // host_pa -> guest_pa -> guest_va
90 int host_pa_to_guest_va(struct guest_info * guest_info, addr_t host_pa, addr_t * guest_va);
91
92 // guest_va -> guest_pa -> host_pa -> host_va
93 int guest_va_to_host_va(struct guest_info * guest_info, addr_t guest_va, addr_t * host_va);
94
95
96 /* !! Currently not implemented !! */
97 // host_va -> host_pa -> guest_pa -> guest_va
98 int host_va_to_guest_va(struct guest_info * guest_info, addr_t host_va, addr_t  * guest_va);
99
100
101
102
103
104
105
106
107
108 int read_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, uchar_t * dest);
109 int read_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int count, uchar_t * dest);
110 int write_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int count, uchar_t * src);
111 // TODO int write_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, char * src);
112
113
114 #endif // ! __V3VEE__
115
116
117 #endif