]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
Fix the performance issues of 2-level paging HVM guests on the PAE
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 15 May 2006 06:49:08 +0000 (07:49 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 15 May 2006 06:49:08 +0000 (07:49 +0100)
Xen. With this, the performance will be basically same as 2-on-2.

Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
xen-unstable changeset:   9991:d20a2a971103e4c9cd09d9284707437cd1c28b77
xen-unstable date:        Mon May 15 07:46:57 2006 +0100

xen/arch/x86/shadow.c

index 8eacde9735fcc549c9ddb8290a18190eacc99023..30bc21c51aeb34152b2db585da687808298d8ba7 100644 (file)
@@ -347,6 +347,13 @@ alloc_shadow_page(struct domain *d,
         d->arch.shadow_page_count++;
         if ( PGT_l4_page_table == PGT_root_page_table )
             pin = 1;
+#if CONFIG_PAGING_LEVELS == 3 & defined (GUEST_PGENTRY_32)
+        /*
+         * We use PGT_l4_shadow for 2-level paging guests on PAE
+         */
+        if ( d->arch.ops->guest_paging_levels == PAGING_L2 )
+            pin = 1;
+#endif
         break;
 
 #if CONFIG_PAGING_LEVELS >= 4
@@ -2379,6 +2386,17 @@ static void shadow_update_pagetables(struct vcpu *v)
     /*
      *  arch.shadow_table
      */
+#if CONFIG_PAGING_LEVELS == 3 & defined (GUEST_PGENTRY_32)
+    /*
+     * We use PGT_l4_shadow for 2-level paging guests on PAE
+     */
+    if ( d->arch.ops->guest_paging_levels == PAGING_L2 )
+    { 
+        if ( unlikely(!(smfn = __shadow_status(d, gpfn, PGT_l4_shadow))) )
+            smfn = shadow_l3_table(v, gpfn, gmfn);
+    } 
+    else
+#endif
     if ( unlikely(!(smfn = __shadow_status(d, gpfn, PGT_base_page_table))) ) 
     {
 #if CONFIG_PAGING_LEVELS == 2