WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Fix shadow mode 32/PAE linux writable heu

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix shadow mode 32/PAE linux writable heuristic and add 64-bit version.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Aug 2006 10:20:14 +0000
Delivery-date: Tue, 29 Aug 2006 03:20:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Steven Hand <steven@xxxxxxxxxxxxx>
# Node ID 78a25a7eac1f9b415f24234c6d243025cee17169
# Parent  28824bd2701c59ae6d6ecda80043986f73d199f2
Fix shadow mode 32/PAE linux writable heuristic and add 64-bit version.

Signed-off-by: Steven Hand <steven@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/shadow/common.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff -r 28824bd2701c -r 78a25a7eac1f xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Mon Aug 28 21:25:13 2006 +0100
+++ b/xen/arch/x86/mm/shadow/common.c   Mon Aug 28 21:40:42 2006 +0100
@@ -1898,16 +1898,16 @@ int shadow_remove_write_access(struct vc
         } while (0)
 
         
-        /* Linux lowmem: first 1GB is mapped 1-to-1 above 0xC0000000 */
-        if ( v == current 
-             && (gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x40000000 )
-            GUESS(0xC0000000 + (gfn << PAGE_SHIFT), 4);
-
         if ( v->arch.shadow.mode->guest_levels == 2 )
         {
             if ( level == 1 )
                 /* 32bit non-PAE w2k3: linear map at 0xC0000000 */
                 GUESS(0xC0000000UL + (fault_addr >> 10), 1);
+
+            /* Linux lowmem: first 896MB is mapped 1-to-1 above 0xC0000000 */
+            if ((gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x38000 ) 
+                GUESS(0xC0000000UL + (gfn << PAGE_SHIFT), 4);
+
         }
 #if CONFIG_PAGING_LEVELS >= 3
         else if ( v->arch.shadow.mode->guest_levels == 3 )
@@ -1918,6 +1918,10 @@ int shadow_remove_write_access(struct vc
             case 1: GUESS(0xC0000000UL + (fault_addr >> 9), 2); break;
             case 2: GUESS(0xC0600000UL + (fault_addr >> 18), 2); break;
             }
+
+            /* Linux lowmem: first 896MB is mapped 1-to-1 above 0xC0000000 */
+            if ((gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x38000 ) 
+                GUESS(0xC0000000UL + (gfn << PAGE_SHIFT), 4);
         }
 #if CONFIG_PAGING_LEVELS >= 4
         else if ( v->arch.shadow.mode->guest_levels == 4 )
@@ -1929,6 +1933,10 @@ int shadow_remove_write_access(struct vc
             case 2: GUESS(0x70380000000UL + (fault_addr >> 18), 3); break;
             case 3: GUESS(0x70381C00000UL + (fault_addr >> 27), 3); break;
             }
+
+            /* Linux direct map at 0xffff810000000000 */
+            gfn = sh_mfn_to_gfn(v->domain, gmfn); 
+            GUESS(0xffff810000000000UL + (gfn << PAGE_SHIFT), 4); 
         }
 #endif /* CONFIG_PAGING_LEVELS >= 4 */
 #endif /* CONFIG_PAGING_LEVELS >= 3 */
@@ -2185,7 +2193,7 @@ void sh_remove_shadows(struct vcpu *v, m
 
     pg = mfn_to_page(gmfn);
 
-    /* Bale out now if the page is not shadowed */
+    /* Bail out now if the page is not shadowed */
     if ( (pg->count_info & PGC_page_table) == 0 )
         return;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix shadow mode 32/PAE linux writable heuristic and add 64-bit version., Xen patchbot-unstable <=