1 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
4 #ifndef __VMM_SHADOW_PAGING_H
5 #define __VMM_SHADOW_PAGING_H
10 #include <palacios/vmm_util.h>
11 #include <palacios/vmm_paging.h>
12 #include <palacios/vmm_hashtable.h>
14 struct shadow_page_state {
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
21 // Should this be here??
24 // these two reflect the top-level page directory
25 // of the shadow page table
26 paging_mode_t shadow_mode;
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;
44 int cache_page_tables32(struct guest_info * info, addr_t pde);
46 int init_shadow_page_state(struct guest_info * info);
48 addr_t create_new_shadow_pt32();
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);
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);