X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_direct_paging_32pae.h;h=fb97ee49739748aae3a00b18e77005e018a3a4a6;hb=123a1ba27ea09c8fa77a1b36ce625b43d7c48b14;hp=27cc9b34aa5d5083173c7fee63aad3d8f238e2b0;hpb=1fe82881720f7f9f64f789871f763aca93b47a7e;p=palacios.git diff --git a/palacios/src/palacios/vmm_direct_paging_32pae.h b/palacios/src/palacios/vmm_direct_paging_32pae.h index 27cc9b3..fb97ee4 100644 --- a/palacios/src/palacios/vmm_direct_paging_32pae.h +++ b/palacios/src/palacios/vmm_direct_paging_32pae.h @@ -42,8 +42,7 @@ static inline int handle_passthrough_pagefault_32pae(struct guest_info * info, struct v3_shadow_region * region = v3_get_shadow_region(info, fault_addr); - if ((region == NULL) || - (region->host_type == SHDW_REGION_INVALID)) { + if (region == NULL) { PrintError("Invalid region in passthrough page fault 32PAE, addr=%p\n", (void *)fault_addr); return -1; @@ -121,4 +120,49 @@ static inline int handle_passthrough_pagefault_32pae(struct guest_info * info, } +static inline int invalidate_addr_32pae(struct guest_info * info, addr_t inv_addr) { + pdpe32pae_t * pdpe = NULL; + pde32pae_t * pde = NULL; + pte32pae_t * pte = NULL; + + + // TODO: + // Call INVLPGA + + // clear the page table entry + int pdpe_index = PDPE32PAE_INDEX(inv_addr); + int pde_index = PDE32PAE_INDEX(inv_addr); + int pte_index = PTE32PAE_INDEX(inv_addr); + + + // Lookup the correct PDE address based on the PAGING MODE + if (info->shdw_pg_mode == SHADOW_PAGING) { + pdpe = CR3_TO_PDPE32PAE_VA(info->ctrl_regs.cr3); + } else { + pdpe = CR3_TO_PDPE32PAE_VA(info->direct_map_pt); + } + + + if (pdpe[pdpe_index].present == 0) { + return 0; + } + + pde = V3_VAddr((void*)BASE_TO_PAGE_ADDR(pdpe[pdpe_index].pd_base_addr)); + + if (pde[pde_index].present == 0) { + return 0; + } else if (pde[pde_index].large_page) { + pde[pde_index].present = 0; + return 0; + } + + pte = V3_VAddr((void*)BASE_TO_PAGE_ADDR(pde[pde_index].pt_base_addr)); + + pte[pte_index].present = 0; + + return 0; +} + + + #endif