From 858f81cb72de745c978d229fdd753eda189cf951 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Fri, 24 Sep 2010 12:44:52 -0400 Subject: [PATCH] --- yaml --- r: 212884 b: refs/heads/master c: 92437d41374bf59b1914b53bd10ca69d31b1b581 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/include/asm/pte-common.h | 7 +++++++ trunk/arch/powerpc/mm/fsl_booke_mmu.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 6f56a59b3d88..3cf8d6eeb2ca 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cd2bd44ea8a2e8be8fff583fa5759e8f3758e67a +refs/heads/master: 92437d41374bf59b1914b53bd10ca69d31b1b581 diff --git a/trunk/arch/powerpc/include/asm/pte-common.h b/trunk/arch/powerpc/include/asm/pte-common.h index f2b370180a09..76bb195e4f24 100644 --- a/trunk/arch/powerpc/include/asm/pte-common.h +++ b/trunk/arch/powerpc/include/asm/pte-common.h @@ -171,6 +171,13 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void); /* Make modules code happy. We don't set RO yet */ #define PAGE_KERNEL_EXEC PAGE_KERNEL_X +/* + * Don't just check for any non zero bits in __PAGE_USER, since for book3e + * and PTE_64BIT, PAGE_KERNEL_X contains _PAGE_BAP_SR which is also in + * _PAGE_USER. Need to explictly match _PAGE_BAP_UR bit in that case too. + */ +#define pte_user(val) ((val & _PAGE_USER) == _PAGE_USER) + /* Advertise special mapping type for AGP */ #define PAGE_AGP (PAGE_KERNEL_NC) #define HAVE_PAGE_AGP diff --git a/trunk/arch/powerpc/mm/fsl_booke_mmu.c b/trunk/arch/powerpc/mm/fsl_booke_mmu.c index 4b66a1ece6d8..1b4354db51bb 100644 --- a/trunk/arch/powerpc/mm/fsl_booke_mmu.c +++ b/trunk/arch/powerpc/mm/fsl_booke_mmu.c @@ -137,7 +137,8 @@ static void settlbcam(int index, unsigned long virt, phys_addr_t phys, if (mmu_has_feature(MMU_FTR_BIG_PHYS)) TLBCAM[index].MAS7 = (u64)phys >> 32; - if (flags & _PAGE_USER) { + /* Below is unlikely -- only for large user pages or similar */ + if (pte_user(flags)) { TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR; TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0); }