1 #ifndef __VMM_SHADOW_PAGING_H
2 #define __VMM_SHADOW_PAGING_H
7 #include <palacios/vmm_util.h>
8 #include <palacios/vmm_paging.h>
9 #include <palacios/vmm_hashtable.h>
11 struct shadow_page_state {
13 // these two reflect the top-level page directory
14 // of the guest page table
15 paging_mode_t guest_mode;
16 ullong_t guest_cr3; // points to guest's current page table
18 // Should this be here??
21 // these two reflect the top-level page directory
22 // of the shadow page table
23 paging_mode_t shadow_mode;
27 // Hash table that ties a CR3 value to a hash table pointer for the PT entries
28 struct hashtable * cr3_cache;
29 // Hash table that contains a mapping of guest pte addresses to host pte addresses
30 struct hashtable * cached_ptes;
41 int cache_page_tables32(struct guest_info * info, addr_t pde);
43 int init_shadow_page_state(struct guest_info * info);
45 addr_t create_new_shadow_pt32();
47 int handle_shadow_pagefault(struct guest_info * info, addr_t fault_addr, pf_error_t error_code);
48 int handle_shadow_invlpg(struct guest_info * info);
53 int v3_replace_shdw_page(struct guest_info * info, addr_t location, void * new_page, void* old_page);
54 int v3_replace_shdw_page32(struct guest_info * info, addr_t location, pte32_t * new_page, pte32_t * old_page);