X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fmmu%2Fvmm_shdw_pg_swapbypass_64.h;h=c3d2964143e5b3f3092ff05a8d8a208d66c39751;hb=e59d15ae2aab909879f817c3f45400d92af98a43;hp=f0dcfdbcc6bf999dd47185ca9a4bfdf6af4ba814;hpb=9959b08bfa0a2a0ee51866199c5b1d7b2b690237;p=palacios.git diff --git a/palacios/src/palacios/mmu/vmm_shdw_pg_swapbypass_64.h b/palacios/src/palacios/mmu/vmm_shdw_pg_swapbypass_64.h index f0dcfdb..c3d2964 100644 --- a/palacios/src/palacios/mmu/vmm_shdw_pg_swapbypass_64.h +++ b/palacios/src/palacios/mmu/vmm_shdw_pg_swapbypass_64.h @@ -452,8 +452,8 @@ static int handle_pte_shadow_pagefault_64(struct guest_info * info, addr_t fault // Page Table Entry Not Present PrintDebug("guest_pa =%p\n", (void *)guest_pa); - if ((shdw_reg->host_type == SHDW_REGION_ALLOCATED) || - (shdw_reg->host_type == SHDW_REGION_WRITE_HOOK)) { + if ((shdw_reg->flags.hook == 1) || + (shdw_reg->flags.read == 1)) { addr_t shadow_pa = v3_get_shadow_addr(shdw_reg, info->cpu_id, guest_pa); shadow_pte->page_base_addr = PAGE_BASE_ADDR(shadow_pa); @@ -480,11 +480,11 @@ static int handle_pte_shadow_pagefault_64(struct guest_info * info, addr_t fault // Write hooks trump all, and are set Read Only - if (shdw_reg->host_type == SHDW_REGION_WRITE_HOOK) { + if (shdw_reg->flags.write == 0) { shadow_pte->writable = 0; } - } else { + } else if (shdw_reg->flags.hook == 1) { // Page fault handled by hook functions if (v3_handle_mem_hook(info, fault_addr, guest_pa, shdw_reg, error_code) == -1) { @@ -495,7 +495,7 @@ static int handle_pte_shadow_pagefault_64(struct guest_info * info, addr_t fault } else if (shadow_pte_access == PT_ACCESS_WRITE_ERROR) { guest_pte->dirty = 1; - if (shdw_reg->host_type == SHDW_REGION_WRITE_HOOK) { + if (shdw_reg->flags.hook == 1) { if (v3_handle_mem_hook(info, fault_addr, guest_pa, shdw_reg, error_code) == -1) { PrintError("Special Page fault handler returned error for address: %p\n", (void *)fault_addr); return -1; @@ -558,8 +558,8 @@ static int handle_2MB_shadow_pagefault_64(struct guest_info * info, if (shadow_pte_access == PT_ACCESS_NOT_PRESENT) { // Get the guest physical address of the fault - if ((shdw_reg->host_type == SHDW_REGION_ALLOCATED) || - (shdw_reg->host_type == SHDW_REGION_WRITE_HOOK)) { + if ((shdw_reg->flags.alloced == 1) || + (shdw_reg->flags.read == 1)) { addr_t shadow_pa = v3_get_shadow_addr(shdw_reg, info->cpu_id, guest_fault_pa); shadow_pte->page_base_addr = PAGE_BASE_ADDR(shadow_pa); @@ -573,7 +573,7 @@ static int handle_2MB_shadow_pagefault_64(struct guest_info * info, */ shadow_pte->user_page = 1; - if (shdw_reg->host_type == SHDW_REGION_WRITE_HOOK) { + if (shdw_reg->flags.write == 0) { shadow_pte->writable = 0; } else { shadow_pte->writable = 1; @@ -585,7 +585,7 @@ static int handle_2MB_shadow_pagefault_64(struct guest_info * info, shadow_pte->global_page = large_guest_pde->global_page; // - } else { + } else if (shdw_reg->flags.hook == 1) { if (v3_handle_mem_hook(info, fault_addr, guest_fault_pa, shdw_reg, error_code) == -1) { PrintError("Special Page Fault handler returned error for address: %p\n", (void *)fault_addr); return -1; @@ -593,7 +593,7 @@ static int handle_2MB_shadow_pagefault_64(struct guest_info * info, } } else if (shadow_pte_access == PT_ACCESS_WRITE_ERROR) { - if (shdw_reg->host_type == SHDW_REGION_WRITE_HOOK) { + if (shdw_reg->flags.hook == 1) { if (v3_handle_mem_hook(info, fault_addr, guest_fault_pa, shdw_reg, error_code) == -1) { PrintError("Special Page Fault handler returned error for address: %p\n", (void *)fault_addr);