[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Don't fully populate the shadow for every L1 we map.



ChangeSet 1.1257, 2005/03/23 12:53:05+00:00, mafetter@xxxxxxxxxxxxxxxx

        Don't fully populate the shadow for every L1 we map.
        Only populate the demanded entry in the L1, and then from entry 0 up to 
the
        first invalid entry.
        
        Signed-off-by: michael.fetterman@xxxxxxxxxxxx



 arch/x86/shadow.c        |   17 +++++++++++++++--
 include/asm-x86/shadow.h |    3 +--
 2 files changed, 16 insertions(+), 4 deletions(-)


diff -Nru a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     2005-04-05 12:17:22 -04:00
+++ b/xen/arch/x86/shadow.c     2005-04-05 12:17:22 -04:00
@@ -1427,14 +1427,27 @@
             &(shadow_linear_pg_table[l1_linear_offset(va) &
                                      ~(L1_PAGETABLE_ENTRIES-1)]);
 
+        memset(spl1e, 0, PAGE_SIZE);
+
+        unsigned long sl1e;
+        int index = l1_table_offset(va);
+
+        l1pte_propagate_from_guest(d, gpl1e[index], &sl1e);
+        if ( (sl1e & _PAGE_PRESENT) &&
+             !shadow_get_page_from_l1e(mk_l1_pgentry(sl1e), d) )
+            sl1e = 0;
+        spl1e[index] = sl1e;
+
         for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
         {
-            unsigned long sl1e;
-
+            if ( i == index )
+                continue;
             l1pte_propagate_from_guest(d, gpl1e[i], &sl1e);
             if ( (sl1e & _PAGE_PRESENT) &&
                  !shadow_get_page_from_l1e(mk_l1_pgentry(sl1e), d) )
                 sl1e = 0;
+            if ( sl1e == 0 )
+                break;
             spl1e[i] = sl1e;
         }
     }
diff -Nru a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      2005-04-05 12:17:22 -04:00
+++ b/xen/include/asm-x86/shadow.h      2005-04-05 12:17:22 -04:00
@@ -609,14 +609,13 @@
 static inline void l1pte_propagate_from_guest(
     struct domain *d, unsigned long gpte, unsigned long *spte_p)
 { 
-    unsigned long pfn = gpte >> PAGE_SHIFT;
     unsigned long mfn, spte;
 
     spte = 0;
 
     if ( ((gpte & (_PAGE_PRESENT|_PAGE_ACCESSED) ) ==
           (_PAGE_PRESENT|_PAGE_ACCESSED)) &&
-         VALID_MFN(mfn = __gpfn_to_mfn(d, pfn)) )
+         VALID_MFN(mfn = __gpfn_to_mfn(d, gpte >> PAGE_SHIFT)) )
     {
         spte = (mfn << PAGE_SHIFT) | (gpte & ~PAGE_MASK);
         

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.