Small fixes to changesets 10424 and 10425 (spurious #PF detection).
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 17 Jun 2006 11:57:03 +0000 (12:57 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 17 Jun 2006 11:57:03 +0000 (12:57 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c
xen/arch/x86/traps.c

index 963446013fdcf35f1840ca00e1c55f46f5a5b815..cb3fe42f0e625e2b12227d8e704d73ca5977ccfc 100644 (file)
@@ -324,7 +324,7 @@ static int spurious_fault(struct pt_regs *regs,
 #endif
 
        /* Reserved-bit violation or user access to kernel space? */
-       if (error_code & PF_RSVD|PF_USER)
+       if (error_code & (PF_RSVD|PF_USER))
                return 0;
 
        pgd = init_mm.pgd + pgd_index(address);
index 9b0b7e31c6afc83970726720846f8e122ac34edb..e80f71326cbb1617bd98373103610e4b04a61407 100644 (file)
@@ -592,6 +592,10 @@ static int __spurious_page_fault(
     l1_pgentry_t l1e, *l1t;
     unsigned int required_flags, disallowed_flags;
 
+    /* Reserved bit violations are never spurious faults. */
+    if ( regs->error_code & PGERR_reserved_bit )
+        return 0;
+
     required_flags  = _PAGE_PRESENT;
     if ( regs->error_code & PGERR_write_access )
         required_flags |= _PAGE_RW;
@@ -654,10 +658,6 @@ static int spurious_page_fault(
     struct domain *d = v->domain;
     int            is_spurious;
 
-    /* Reserved bit violations are never spurious faults. */
-    if ( regs->error_code & PGERR_reserved_bit )
-        return 0;
-
     LOCK_BIGLOCK(d);
 
     is_spurious = __spurious_page_fault(addr, regs);