From: Peter Dinda Date: Thu, 31 Jul 2008 19:25:44 +0000 (+0000) Subject: write_cr3 optimization to reuse page table if cr3 is unchanged is now X-Git-Tag: vmmhack1-ramdisk-boot-iso-puppy~29 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=9b78fe7d41b07fd135eae2282cc18ccb964e7de3 write_cr3 optimization to reuse page table if cr3 is unchanged is now set by flag at top of file, and flag is off - optimization fails on linux (unclear why) --- diff --git a/palacios/src/palacios/vmm_ctrl_regs.c b/palacios/src/palacios/vmm_ctrl_regs.c index 4439355..6473e4a 100644 --- a/palacios/src/palacios/vmm_ctrl_regs.c +++ b/palacios/src/palacios/vmm_ctrl_regs.c @@ -20,6 +20,13 @@ #endif +// Set to 1 if CR3 reload with same value shall not +// force a shadow page table flush +// It makes windows loading MUCH faster. +// Note that this optimization appears to fail with a 2.6 linux kernel +#define CR3_RELOAD_OPTIMIZATION 0 + + @@ -238,7 +245,7 @@ int handle_cr3_write(struct guest_info * info) { PrintDebug("Old Shadow CR3=%x; Old Guest CR3=%x\n", *(uint_t*)shadow_cr3, *(uint_t*)guest_cr3); - if (1 || !CR3_32_SAME_BASE(new_cr3, guest_cr3)) { + if (!CR3_RELOAD_OPTIMIZATION || !CR3_32_SAME_BASE(new_cr3, guest_cr3)) { addr_t shadow_pt;