X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_shadow_paging.c;h=eeb493bc841b5e6380d0bdec559ae14b9667be85;hp=0cc5dc5731a4cf8925f073991886cca422415ac8;hb=316c417125ed34aaa60f9fc5486a6d8dec4fb361;hpb=78818a71a31b4cbe264c1292f7bcbdbfd2ceb544 diff --git a/palacios/src/palacios/vmm_shadow_paging.c b/palacios/src/palacios/vmm_shadow_paging.c index 0cc5dc5..eeb493b 100644 --- a/palacios/src/palacios/vmm_shadow_paging.c +++ b/palacios/src/palacios/vmm_shadow_paging.c @@ -30,7 +30,11 @@ #include -#ifndef DEBUG_SHADOW_PAGING +#ifdef CONFIG_SYMBIOTIC_SWAP +#include +#endif + +#ifndef CONFIG_DEBUG_SHADOW_PAGING #undef PrintDebug #define PrintDebug(fmt, args...) #endif @@ -66,6 +70,7 @@ int v3_init_shadow_page_state(struct guest_info * info) { state->guest_cr3 = 0; state->guest_cr0 = 0; + state->guest_efer.value = 0x0LL; INIT_LIST_HEAD(&(state->page_list)); @@ -236,11 +241,15 @@ static struct shadow_page_data * create_new_shadow_pt(struct guest_info * info) static int inject_guest_pf(struct guest_info * info, addr_t fault_addr, pf_error_t error_code) { + +#ifdef CONFIG_PROFILE_VMM if (info->enable_profiler) { info->profiler.guest_pf_cnt++; } +#endif info->ctrl_regs.cr2 = fault_addr; + return v3_raise_exception_with_error(info, PF_EXCEPTION, *(uint_t *)&error_code); } @@ -264,12 +273,19 @@ static int is_guest_pf(pt_access_status_t guest_access, pt_access_status_t shado return 1; } - if ((shadow_access == PT_ACCESS_NOT_PRESENT) && - (guest_access == PT_ACCESS_NOT_PRESENT)) { + /* + if ((shadow_access == PT_ACCESS_NOT_PRESENT) && + (guest_access == PT_ACCESS_NOT_PRESENT)) { + // Page tables completely blank, handle guest first + return 1; + } + */ + + if (guest_access == PT_ACCESS_NOT_PRESENT) { // Page tables completely blank, handle guest first return 1; } - + // Otherwise we'll handle the guest fault later...? }