diff options
-rw-r--r-- | arch/powerpc/include/asm/pte-common.h | 7 | ||||
-rw-r--r-- | arch/powerpc/mm/fsl_booke_mmu.c | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/pte-common.h b/arch/powerpc/include/asm/pte-common.h index f2b370180a09..76bb195e4f24 100644 --- a/arch/powerpc/include/asm/pte-common.h +++ b/arch/powerpc/include/asm/pte-common.h | |||
@@ -171,6 +171,13 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void); | |||
171 | /* Make modules code happy. We don't set RO yet */ | 171 | /* Make modules code happy. We don't set RO yet */ |
172 | #define PAGE_KERNEL_EXEC PAGE_KERNEL_X | 172 | #define PAGE_KERNEL_EXEC PAGE_KERNEL_X |
173 | 173 | ||
174 | /* | ||
175 | * Don't just check for any non zero bits in __PAGE_USER, since for book3e | ||
176 | * and PTE_64BIT, PAGE_KERNEL_X contains _PAGE_BAP_SR which is also in | ||
177 | * _PAGE_USER. Need to explictly match _PAGE_BAP_UR bit in that case too. | ||
178 | */ | ||
179 | #define pte_user(val) ((val & _PAGE_USER) == _PAGE_USER) | ||
180 | |||
174 | /* Advertise special mapping type for AGP */ | 181 | /* Advertise special mapping type for AGP */ |
175 | #define PAGE_AGP (PAGE_KERNEL_NC) | 182 | #define PAGE_AGP (PAGE_KERNEL_NC) |
176 | #define HAVE_PAGE_AGP | 183 | #define HAVE_PAGE_AGP |
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c index 4b66a1ece6d8..1b4354db51bb 100644 --- a/arch/powerpc/mm/fsl_booke_mmu.c +++ b/arch/powerpc/mm/fsl_booke_mmu.c | |||
@@ -137,7 +137,8 @@ static void settlbcam(int index, unsigned long virt, phys_addr_t phys, | |||
137 | if (mmu_has_feature(MMU_FTR_BIG_PHYS)) | 137 | if (mmu_has_feature(MMU_FTR_BIG_PHYS)) |
138 | TLBCAM[index].MAS7 = (u64)phys >> 32; | 138 | TLBCAM[index].MAS7 = (u64)phys >> 32; |
139 | 139 | ||
140 | if (flags & _PAGE_USER) { | 140 | /* Below is unlikely -- only for large user pages or similar */ |
141 | if (pte_user(flags)) { | ||
141 | TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR; | 142 | TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR; |
142 | TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0); | 143 | TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0); |
143 | } | 144 | } |