X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fmmu%2Fvmm_shdw_pg_tlb.c;h=9c5545cb0d80b489cb5c1094e982189a42427545;hb=894733a198529cfaf93f4f4b68b255906154ab56;hp=51e88e8b3caaae8edcf1456391118c293bb7117b;hpb=82071a7f5f0b18fbf1a4adc2a37fed1624572a79;p=palacios.git diff --git a/palacios/src/palacios/mmu/vmm_shdw_pg_tlb.c b/palacios/src/palacios/mmu/vmm_shdw_pg_tlb.c index 51e88e8..9c5545c 100644 --- a/palacios/src/palacios/mmu/vmm_shdw_pg_tlb.c +++ b/palacios/src/palacios/mmu/vmm_shdw_pg_tlb.c @@ -12,6 +12,8 @@ * All rights reserved. * * Author: Jack Lange + * Author: Chunxiao Diao + * * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "V3VEE_LICENSE". @@ -52,24 +54,12 @@ static struct shadow_page_data * create_new_shadow_pt(struct guest_info * core); #include "vmm_shdw_pg_tlb_32pae.h" #include "vmm_shdw_pg_tlb_64.h" - static inline int get_constraints(struct guest_info *core) { - switch (v3_get_vm_cpu_mode(core)) { - case PROTECTED: - case PROTECTED_PAE: - return V3_ALLOC_PAGES_CONSTRAINT_4GB; - break; - case LONG: - case LONG_32_COMPAT: - case LONG_16_COMPAT: - return 0; - break; - default: - return V3_ALLOC_PAGES_CONSTRAINT_4GB; - break; - } - return V3_ALLOC_PAGES_CONSTRAINT_4GB; + // the current version of VTLB does not require any constraints + // on where page tables are allocated since it will use + // 32PAE page tables on a 64 bit machine even in 32 bit mode and below + return 0; } @@ -211,7 +201,7 @@ static int vtlb_invalidate_shdw_pt(struct guest_info * core) { static int vtlb_handle_pf(struct guest_info * core, addr_t fault_addr, pf_error_t error_code) { - + switch (v3_get_vm_cpu_mode(core)) { case PROTECTED: return handle_shadow_pagefault_32(core, fault_addr, error_code); @@ -235,15 +225,19 @@ static int vtlb_handle_invlpg(struct guest_info * core, addr_t vaddr) { switch (v3_get_vm_cpu_mode(core)) { case PROTECTED: return handle_shadow_invlpg_32(core, vaddr); + break; case PROTECTED_PAE: return handle_shadow_invlpg_32pae(core, vaddr); + break; case LONG: case LONG_32_COMPAT: case LONG_16_COMPAT: return handle_shadow_invlpg_64(core, vaddr); + break; default: PrintError(core->vm_info, core, "Invalid CPU mode: %s\n", v3_cpu_mode_to_str(v3_get_vm_cpu_mode(core))); return -1; + break; } }