[RFC PATCH v2 09/13] powerpc/syscall: Selectively check MSR_RI and MSR_PR on syscall entry

From: Christophe Leroy
Date: Sun Apr 05 2020 - 13:44:49 EST


In system_call_exception(), MSR_RI needs to also be checked on 8xx.
Only book3e doesn't have MSR_RI.

On PPC32, MSR_PR is checked in real mode to avoid clobbering the
stack, so no need to check and panic in system_call_exception().

Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
---
arch/powerpc/kernel/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/syscall.c b/arch/powerpc/kernel/syscall.c
index 986489ea9fb4..69d75fc4a5eb 100644
--- a/arch/powerpc/kernel/syscall.c
+++ b/arch/powerpc/kernel/syscall.c
@@ -36,9 +36,9 @@ notrace long system_call_exception(long r3, long r4, long r5,

trace_hardirqs_off(); /* finish reconciling */

- if (IS_ENABLED(CONFIG_PPC_BOOK3S))
+ if (!IS_ENABLED(CONFIG_PPC_BOOK3E))
BUG_ON(!(regs->msr & MSR_RI));
- BUG_ON(!(regs->msr & MSR_PR));
+ BUG_ON(IS_ENABLED(CONFIG_PPC64) && !(regs->msr & MSR_PR));
BUG_ON(!FULL_REGS(regs));
#ifdef CONFIG_PPC64
BUG_ON(regs->softe != IRQS_ENABLED);
--
2.25.0