[PATCH v2 12/18] powerpc: have copy depend on CONFIG_BOOK3S_64

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Sat Oct 7 13:28:12 AEDT 2017


Have the COPY/PASTE instructions depend on CONFIG_BOOK3S_64 rather than
CONFIG_PPC_STD_MMU_64.

Signed-off-by: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
---
 arch/powerpc/kernel/process.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index a0c74bb..37ed60b 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1215,10 +1215,14 @@ struct task_struct *__switch_to(struct task_struct *prev,
 		batch = this_cpu_ptr(&ppc64_tlb_batch);
 		batch->active = 1;
 	}
+#endif /* CONFIG_PPC_STD_MMU_64 */
 
 	if (current_thread_info()->task->thread.regs) {
+#ifdef CONFIG_PPC_STD_MMU_64
 		restore_math(current_thread_info()->task->thread.regs);
+#endif /* CONFIG_PPC_STD_MMU_64 */
 
+#ifdef CONFIG_PPC_BOOK3S_64
 		/*
 		 * The copy-paste buffer can only store into foreign real
 		 * addresses, so unprivileged processes can not see the
@@ -1237,8 +1241,8 @@ struct task_struct *__switch_to(struct task_struct *prev,
 			asm volatile(PPC_COPY(%0, %1)
 					: : "r"(dummy_copy_buffer), "r"(0));
 		}
+#endif /* CONFIG_PPC_BOOK3S_64 */
 	}
-#endif /* CONFIG_PPC_STD_MMU_64 */
 
 	return last;
 }
-- 
2.7.4



More information about the Linuxppc-dev mailing list