Subject: [PATCH] powerpc/mm/radix: Do slb preload only with hash translation mode

From: "Aneesh Kumar K.V" <[email-masked]>
Date: Tue, 9 Apr 2019 09:33:28 +0530

Add radix_enabled check to avoid slb preload with radix translation.

Signed-off-by: Aneesh Kumar K.V <[email-masked]>
---

Without this we result in kernel crash as we move hash related variables
out of mm_context_t

 arch/powerpc/kernel/process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index dd9e0d5386ee..f7b2e3b3db28 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1729,7 +1729,8 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
 	unsigned long load_addr = regs->gpr[2];	/* saved by ELF_PLAT_INIT */
 
 #ifdef CONFIG_PPC_BOOK3S_64
-	preload_new_slb_context(start, sp);
+	if (!radix_enabled())
+		preload_new_slb_context(start, sp);
 #endif
 #endif
 
-- 
2.20.1