From: kaf24@firebug.cl.cam.ac.uk Date: Sat, 17 Jun 2006 11:57:03 +0000 (+0100) Subject: Small fixes to changesets 10424 and 10425 (spurious #PF detection). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15921^2~40 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9c8f5290ef3d666eb6867de26ac7ba85508b5fb6;p=xen.git Small fixes to changesets 10424 and 10425 (spurious #PF detection). Signed-off-by: Keir Fraser --- diff --git a/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c b/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c index 963446013f..cb3fe42f0e 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c @@ -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); diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 9b0b7e31c6..e80f71326c 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -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);