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.


added copyright tags
[palacios.git] / palacios / include / palacios / vmm_shadow_paging.h
1 /* Northwestern University */
2 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
3
4 #ifndef __VMM_SHADOW_PAGING_H
5 #define __VMM_SHADOW_PAGING_H
6
7
8 #ifdef __V3VEE__
9
10 #include <palacios/vmm_util.h>
11 #include <palacios/vmm_paging.h>
12 #include <palacios/vmm_hashtable.h>
13
14 struct shadow_page_state {
15
16   // these two reflect the top-level page directory
17   // of the guest page table
18   paging_mode_t           guest_mode;
19   ullong_t                guest_cr3;         // points to guest's current page table
20
21   // Should this be here??
22   ullong_t guest_cr0;
23
24   // these two reflect the top-level page directory 
25   // of the shadow page table
26   paging_mode_t           shadow_mode;
27   ullong_t                shadow_cr3;
28
29
30   // Hash table that ties a CR3 value to a hash table pointer for the PT entries
31   struct hashtable *  cr3_cache;
32   // Hash table that contains a mapping of guest pte addresses to host pte addresses
33   struct hashtable *  cached_ptes;
34   addr_t cached_cr3;
35
36 };
37
38
39
40 struct guest_info;
41
42
43
44 int cache_page_tables32(struct guest_info * info, addr_t  pde);
45
46 int init_shadow_page_state(struct guest_info * info);
47
48 addr_t create_new_shadow_pt32();
49
50 int handle_shadow_pagefault(struct guest_info * info, addr_t fault_addr, pf_error_t error_code);
51 int handle_shadow_invlpg(struct guest_info * info);
52
53
54
55
56 int v3_replace_shdw_page(struct guest_info * info, addr_t location, void * new_page, void* old_page);
57 int v3_replace_shdw_page32(struct guest_info * info, addr_t location, pte32_t * new_page, pte32_t * old_page); 
58
59 #endif // ! __V3VEE__
60
61 #endif