diff mbox series

[RFC,v3,12/15] powerpc/syscall: Selectively check MSR_RI and MSR_PR on syscall entry

Message ID 99851590f78150820e1c21af7f6370d7b82830e9.1586196948.git.christophe.leroy@c-s.fr (mailing list archive)
State RFC
Headers show
Series [RFC,v3,01/15] powerpc/syscall: Refactorise from Nick | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/merge (2c0ce4ff35994a7b12cc9879ced52c9e7c2e6667)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/next (6ba4a2d3591039aea1cb45c7c42262d26351a2fa)
snowpatch_ozlabs/apply_patch success Successfully applied on branch linus/master (7e63420847ae5f1036e4f7c42f0b3282e73efbc2)
snowpatch_ozlabs/checkpatch warning total: 0 errors, 1 warnings, 0 checks, 11 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Christophe Leroy April 6, 2020, 6:16 p.m. UTC
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@c-s.fr>
---
 arch/powerpc/kernel/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/syscall.c b/arch/powerpc/kernel/syscall.c
index dfd7b28239b8..f9fca9985b0f 100644
--- a/arch/powerpc/kernel/syscall.c
+++ b/arch/powerpc/kernel/syscall.c
@@ -34,9 +34,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));
 	BUG_ON(IS_ENABLED(CONFIG_PPC64) && get_softe(regs) != IRQS_ENABLED);