X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_direct_paging_32.h;h=b211ad95c01288cd592e4c3b4cb8b1852bdd95f4;hb=0a7690f54cb5bda83780dac26ce433ad24b1d766;hp=0ca5287d7025b9daf11a5530c1e3f0fc81a91d4b;hpb=b93aeabee44c82139a9afd065dfcaca8ac6688ad;p=palacios.git diff --git a/palacios/src/palacios/vmm_direct_paging_32.h b/palacios/src/palacios/vmm_direct_paging_32.h index 0ca5287..b211ad9 100644 --- a/palacios/src/palacios/vmm_direct_paging_32.h +++ b/palacios/src/palacios/vmm_direct_paging_32.h @@ -39,7 +39,7 @@ static inline int handle_passthrough_pagefault_32(struct guest_info * info, int pde_index = PDE32_INDEX(fault_addr); int pte_index = PTE32_INDEX(fault_addr); - struct v3_shadow_region * region = v3_get_shadow_region(info->vm_info, info->cpu_id, fault_addr); + struct v3_mem_region * region = v3_get_mem_region(info->vm_info, info->cpu_id, fault_addr); if (region == NULL) { PrintError("Invalid region in passthrough page fault 32, addr=%p\n", @@ -47,8 +47,6 @@ static inline int handle_passthrough_pagefault_32(struct guest_info * info, return -1; } - host_addr = v3_get_shadow_addr(region, info->cpu_id, fault_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); @@ -86,6 +84,11 @@ static inline int handle_passthrough_pagefault_32(struct guest_info * info, } else { pte[pte_index].writable = 0; } + + if (v3_gpa_to_hpa(info, fault_addr, &host_addr) == -1) { + PrintError("Could not translate fault address (%p)\n", (void *)fault_addr); + return -1; + } pte[pte_index].page_base_addr = PAGE_BASE_ADDR(host_addr); } else {