X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_direct_paging_32.h;h=c15712bb2d756b95a3a738a0699cf45df67e4d29;hp=42da5b14ac7df88ede0e7ac6a0bf92ef2d2cdb90;hb=b06d0d0e5e57f5c4163a69efcabe6f96594ad814;hpb=defcfbf9d03f49b7895ba23ca510782477a3425c diff --git a/palacios/src/palacios/vmm_direct_paging_32.h b/palacios/src/palacios/vmm_direct_paging_32.h index 42da5b1..c15712b 100644 --- a/palacios/src/palacios/vmm_direct_paging_32.h +++ b/palacios/src/palacios/vmm_direct_paging_32.h @@ -107,4 +107,40 @@ static inline int handle_passthrough_pagefault_32(struct guest_info * info, } + + +static inline int invalidate_addr_32(struct guest_info * info, addr_t inv_addr) { + pde32_t * pde = NULL; + pte32_t * pte = NULL; + + // TODO: + // Call INVLPGA + + // clear the page table entry + int pde_index = PDE32_INDEX(inv_addr); + int pte_index = PTE32_INDEX(inv_addr); + + + // Lookup the correct PDE address based on the PAGING MODE + if (info->shdw_pg_mode == SHADOW_PAGING) { + pde = CR3_TO_PDE32_VA(info->ctrl_regs.cr3); + } else { + pde = CR3_TO_PDE32_VA(info->direct_map_pt); + } + + 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