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.


fixing the error in geekos' memcmp implementation
[palacios-OLD.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 #include <palacios/vm_guest.h>
24 #include <palacios/vmm_mem.h>
25
26
27 /* These functions are ordered such that they can only call the functions defined in a lower order group */
28 /* This is to avoid infinite lookup loops */
29
30 /**********************************/
31 /* GROUP 0                        */
32 /**********************************/
33
34 /* Fundamental converters */
35 // Call out to OS
36 int host_va_to_host_pa(addr_t host_va, addr_t * host_pa);
37 int host_pa_to_host_va(addr_t host_pa, addr_t * host_va);
38
39 // guest_pa -> (shadow map) -> host_pa
40 int guest_pa_to_host_pa(struct guest_info * guest_info, addr_t guest_pa, addr_t * host_pa);
41
42 /* !! Currently not implemented !! */
43 // host_pa -> (shadow_map) -> guest_pa
44 int host_pa_to_guest_pa(struct guest_info * guest_info, addr_t host_pa, addr_t * guest_pa);
45
46
47 /**********************************/
48 /* GROUP 1                        */
49 /**********************************/
50
51
52 /* !! Currently not implemented !! */
53 // host_va -> host_pa -> guest_pa
54 int host_va_to_guest_pa(struct guest_info * guest_info, addr_t host_va, addr_t * guest_pa);
55
56
57 // guest_pa -> host_pa -> host_va
58 int guest_pa_to_host_va(struct guest_info * guest_info, addr_t guest_pa, addr_t * host_va);
59
60
61 // Look up the address in the guests page tables.. This can cause multiple calls that translate
62 //     ------------------------------------------------
63 //     |                                              |
64 //     -->   guest_pa -> host_pa -> host_va ->   (read table) --> guest_pa
65 int guest_va_to_guest_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * guest_pa);
66
67
68
69 /* !! Currently not implemented !! */
70 //   A page table walker in the guest's address space
71 //     ------------------------------------------------
72 //     |                                              |
73 //     -->   guest_pa -> host_pa -> host_va ->   (read table) --> guest_va
74 int guest_pa_to_guest_va(struct guest_info * guest_info, addr_t guest_pa, addr_t * guest_va);
75
76
77
78 /**********************************/
79 /* GROUP 2                        */
80 /**********************************/
81 // guest_va -> guest_pa -> host_pa
82 int guest_va_to_host_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * host_pa);
83
84
85 /* !! Currently not implemented !! */
86 // host_pa -> guest_pa -> guest_va
87 int host_pa_to_guest_va(struct guest_info * guest_info, addr_t host_pa, addr_t * guest_va);
88
89 // guest_va -> guest_pa -> host_pa -> host_va
90 int guest_va_to_host_va(struct guest_info * guest_info, addr_t guest_va, addr_t * host_va);
91
92
93 /* !! Currently not implemented !! */
94 // host_va -> host_pa -> guest_pa -> guest_va
95 int host_va_to_guest_va(struct guest_info * guest_info, addr_t host_va, addr_t  * guest_va);
96
97
98
99
100
101
102
103
104
105 int read_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, char * dest);
106 int read_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int count, char * dest);
107 int write_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int count, char * src);
108 // TODO int write_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, char * src);
109
110
111
112
113
114 #endif