summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/pgtable.h
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2015-07-18 14:24:57 -0500
committerScott Wood <scottwood@freescale.com>2015-08-07 23:00:01 -0500
commit0d61f0b3e222b588480e2ad1e85bb2ea57561c4b (patch)
treedfc4af3ad3b0c421b5855218b133a918ed894bc1 /arch/powerpc/include/asm/pgtable.h
parentcf184dc2dd33847f4b211b01d8c7ec0526e6c5e4 (diff)
downloadlinux-0d61f0b3e222b588480e2ad1e85bb2ea57561c4b.tar.gz
linux-0d61f0b3e222b588480e2ad1e85bb2ea57561c4b.tar.bz2
linux-0d61f0b3e222b588480e2ad1e85bb2ea57561c4b.zip
powerpc/booke64: Move mb() to __set_pte_at() with kernel-addr test
map_kernel() doesn't catch all places that create kernel PTEs. In particular, vmalloc() calls set_pte_at() directly. This causes a crash when booting a non-SMP kernel on e6500. Move the sync to __set_pte(), to be executed only for kernel addresses. Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/include/asm/pgtable.h')
-rw-r--r--arch/powerpc/include/asm/pgtable.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 11a38635dd65..0717693c8428 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -169,6 +169,17 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
* cases, and 32-bit non-hash with 32-bit PTEs.
*/
*ptep = pte;
+
+#ifdef CONFIG_PPC_BOOK3E_64
+ /*
+ * With hardware tablewalk, a sync is needed to ensure that
+ * subsequent accesses see the PTE we just wrote. Unlike userspace
+ * mappings, we can't tolerate spurious faults, so make sure
+ * the new PTE will be seen the first time.
+ */
+ if (is_kernel_addr(addr))
+ mb();
+#endif
#endif
}