From: Jeremy Fitzhardinge Date: Wed, 30 Jan 2008 12:33:39 +0000 (+0100) Subject: xen: fix mismerge in masking pte flags X-Git-Tag: v2.6.25-rc1~1143^2~152 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a89780f3b84f9a421e2608580b55f12b3ac4f9c2;p=linux-2.6 xen: fix mismerge in masking pte flags 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 Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 3e9e095c29..e618473554 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -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 }; }