[PATCH 01 of 11] xen: fix mismerge in masking pte flags

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: LKML <linux-kernel@...>, Andi Kleen <ak@...>, Jan Beulich <jbeulich@...>, Eduardo Pereira Habkost <ehabkost@...>, Ian Campbell <ijc@...>, H Peter Anvin <hpa@...>
Date: Friday, January 25, 2008 - 5:23 pm

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>
---
 arch/x86/xen/mmu.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -244,8 +244,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 };
 }
@@ -291,10 +293,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 };
 }


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00 of 11] x86: separate pmd lifetime from pgd, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
Re: [PATCH 00 of 11] x86: separate pmd lifetime from pgd, Jeremy Fitzhardinge, (Mon Jan 28, 12:20 pm)
Re: [PATCH 00 of 11] x86: separate pmd lifetime from pgd, Jeremy Fitzhardinge, (Mon Jan 28, 11:39 am)
[PATCH 11 of 11] x86: defer cr3 reload when doing pud_clear(), Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 09 of 11] x86: preallocate pmds at pgd creation time, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 08 of 11] xen: deal with pmd being allocated/freed, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 05 of 11] x86: demacro asm-x86/pgalloc_32.h, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 10 of 11] x86: allocate and initialize unshared pmds, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 07 of 11] x86: don't special-case pmd allocations as ..., Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 02 of 11] x86: use the same pgd_list for PAE and 64-bit, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 03 of 11] x86: add mm parameter to paravirt_alloc_pd, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 01 of 11] xen: fix mismerge in masking pte flags, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
[PATCH 04 of 11] x86: fix early_ioremap pagetable ops, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)
Re: [PATCH 04 of 11] x86: fix early_ioremap pagetable ops, Jeremy Fitzhardinge, (Thu Jan 31, 4:41 pm)
Re: [PATCH 04 of 11] x86: fix early_ioremap pagetable ops, Jeremy Fitzhardinge, (Thu Jan 31, 3:52 pm)
[PATCH 06 of 11] x86: unify PAE/non-PAE pgd_ctor, Jeremy Fitzhardinge, (Fri Jan 25, 5:23 pm)