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

[Xen-changelog] [xen-4.1-testing] x86/mm: Don't check for invalid bits in non-present PTEs.



# HG changeset patch
# User Tim Deegan <tim@xxxxxxx>
# Date 1331109149 0
# Node ID b9e672d78cecfff31ef7d9478ca229997dddbec0
# Parent  d4ae43e71dcfd6142b1178e993a3ee3f3f550a9a
x86/mm: Don't check for invalid bits in non-present PTEs.

If _PAGE_PRESENT is clean in a pagetable entry, any pattern of bits
is valid in the rest of the entry.  OSes that special-case
PFEC_invalid_bits (since it should never happen) will be confused
by our setting it in this way.

Signed-off-by: Tim Deegan <tim@xxxxxxx>
xen-unstable changeset:   24883:adcd6ab160fa
xen-unstable date:        Thu Feb 23 10:29:27 2012 +0000
---


diff -r d4ae43e71dcf -r b9e672d78cec xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c      Wed Mar 07 08:29:53 2012 +0000
+++ b/xen/arch/x86/mm/guest_walk.c      Wed Mar 07 08:32:29 2012 +0000
@@ -162,8 +162,11 @@
     l4p = (guest_l4e_t *) top_map;
     gw->l4e = l4p[guest_l4_table_offset(va)];
     gflags = guest_l4e_get_flags(gw->l4e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT ) goto out;
 
     /* Map the l3 table */
     l3p = map_domain_gfn(p2m, 
@@ -176,9 +179,11 @@
     /* Get the l3e and check its flags*/
     gw->l3e = l3p[guest_l3_table_offset(va)];
     gflags = guest_l3e_get_flags(gw->l3e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT )
-        goto out;
 
 #else /* PAE only... */
 
@@ -213,9 +218,11 @@
 #endif /* All levels... */
 
     gflags = guest_l2e_get_flags(gw->l2e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT )
-        goto out;
 
     pse = (guest_supports_superpages(v) && 
            (guest_l2e_get_flags(gw->l2e) & _PAGE_PSE)); 
@@ -277,6 +284,10 @@
             goto out;
         gw->l1e = l1p[guest_l1_table_offset(va)];
         gflags = guest_l1e_get_flags(gw->l1e) ^ iflags;
+        if ( !(gflags & _PAGE_PRESENT) ) {
+            rc |= _PAGE_PRESENT;
+            goto out;
+        }
         rc |= ((gflags & mflags) ^ mflags);
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.