aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-04-07 00:39:36 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-04-07 00:39:47 -0400
commit55052eeca6d71d76f7c3f156c0501814d8e5e6d3 (patch)
tree7a13664cc8c99ffbad425dbc0eefd4ccceb70b8a /arch/powerpc
parentf467bc148d05a1465211102804858df9c667f8b9 (diff)
powerpc: Fix ioremap_flags() with book3e pte definition
We can't just clear the user read permission in book3e pte, because that will also clear supervisor read permission. This surely isn't desired. Fix the problem by adding the supervisor read back. BenH: Slightly simplified the ifdef and applied to ppc64 too Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/mm/pgtable_32.c8
-rw-r--r--arch/powerpc/mm/pgtable_64.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index b9243e7557a..767b0cf17d3 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -146,6 +146,14 @@ ioremap_flags(phys_addr_t addr, unsigned long size, unsigned long flags)
146 /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */ 146 /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
147 flags &= ~(_PAGE_USER | _PAGE_EXEC); 147 flags &= ~(_PAGE_USER | _PAGE_EXEC);
148 148
149#ifdef _PAGE_BAP_SR
150 /* _PAGE_USER contains _PAGE_BAP_SR on BookE using the new PTE format
151 * which means that we just cleared supervisor access... oops ;-) This
152 * restores it
153 */
154 flags |= _PAGE_BAP_SR;
155#endif
156
149 return __ioremap_caller(addr, size, flags, __builtin_return_address(0)); 157 return __ioremap_caller(addr, size, flags, __builtin_return_address(0));
150} 158}
151EXPORT_SYMBOL(ioremap_flags); 159EXPORT_SYMBOL(ioremap_flags);
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index d95679a5fb2..d050fc8d971 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -265,6 +265,14 @@ void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size,
265 /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */ 265 /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
266 flags &= ~(_PAGE_USER | _PAGE_EXEC); 266 flags &= ~(_PAGE_USER | _PAGE_EXEC);
267 267
268#ifdef _PAGE_BAP_SR
269 /* _PAGE_USER contains _PAGE_BAP_SR on BookE using the new PTE format
270 * which means that we just cleared supervisor access... oops ;-) This
271 * restores it
272 */
273 flags |= _PAGE_BAP_SR;
274#endif
275
268 if (ppc_md.ioremap) 276 if (ppc_md.ioremap)
269 return ppc_md.ioremap(addr, size, flags, caller); 277 return ppc_md.ioremap(addr, size, flags, caller);
270 return __ioremap_caller(addr, size, flags, caller); 278 return __ioremap_caller(addr, size, flags, caller);