summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/pgtable_64.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-04-07 14:39:36 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-04-07 14:39:47 +1000
commit55052eeca6d71d76f7c3f156c0501814d8e5e6d3 (patch)
tree7a13664cc8c99ffbad425dbc0eefd4ccceb70b8a /arch/powerpc/mm/pgtable_64.c
parentf467bc148d05a1465211102804858df9c667f8b9 (diff)
downloadop-kernel-dev-55052eeca6d71d76f7c3f156c0501814d8e5e6d3.zip
op-kernel-dev-55052eeca6d71d76f7c3f156c0501814d8e5e6d3.tar.gz
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/mm/pgtable_64.c')
-rw-r--r--arch/powerpc/mm/pgtable_64.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index d95679a..d050fc8 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,
/* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
flags &= ~(_PAGE_USER | _PAGE_EXEC);
+#ifdef _PAGE_BAP_SR
+ /* _PAGE_USER contains _PAGE_BAP_SR on BookE using the new PTE format
+ * which means that we just cleared supervisor access... oops ;-) This
+ * restores it
+ */
+ flags |= _PAGE_BAP_SR;
+#endif
+
if (ppc_md.ioremap)
return ppc_md.ioremap(addr, size, flags, caller);
return __ioremap_caller(addr, size, flags, caller);
OpenPOWER on IntegriCloud