]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
xen: fix mismerge in masking pte flags
authorJeremy Fitzhardinge <jeremy@goop.org>
Wed, 30 Jan 2008 12:33:39 +0000 (13:33 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:33:39 +0000 (13:33 +0100)
Looks like a mismerge/misapply dropped one of the cases of pte flag
masking for Xen.  Also, only mask the flags for present ptes.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/xen/mmu.c

index 3e9e095c295ce8566c33688345f81a50f9e54ee9..e6184735545f82ed5da6a2dc36b4f3a23ae6f492 100644 (file)
@@ -241,8 +241,10 @@ unsigned long long xen_pgd_val(pgd_t pgd)
 
 pte_t xen_make_pte(unsigned long long pte)
 {
-       if (pte & 1)
+       if (pte & _PAGE_PRESENT) {
                pte = phys_to_machine(XPADDR(pte)).maddr;
+               pte &= ~(_PAGE_PCD | _PAGE_PWT);
+       }
 
        return (pte_t){ .pte = pte };
 }
@@ -288,10 +290,10 @@ unsigned long xen_pgd_val(pgd_t pgd)
 
 pte_t xen_make_pte(unsigned long pte)
 {
-       if (pte & _PAGE_PRESENT)
+       if (pte & _PAGE_PRESENT) {
                pte = phys_to_machine(XPADDR(pte)).maddr;
-
-       pte &= ~(_PAGE_PCD | _PAGE_PWT);
+               pte &= ~(_PAGE_PCD | _PAGE_PWT);
+       }
 
        return (pte_t){ pte };
 }