Skip to content

Commit

Permalink
powerpc/syscall: Change condition to check MSR_RI
Browse files Browse the repository at this point in the history
In system_call_exception(), MSR_RI also needs to be checked on 8xx.
Only booke and 40x doesn't have MSR_RI.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/67820fada8dd6a8fe9d7b666f175d4cc9d8de87e.1612796617.git.christophe.leroy@csgroup.eu
  • Loading branch information
chleroy authored and mpe committed Feb 11, 2021
1 parent 8875f47 commit c01b916
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/powerpc/kernel/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ 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_BOOKE) && !IS_ENABLED(CONFIG_40x))
BUG_ON(!(regs->msr & MSR_RI));
BUG_ON(!(regs->msr & MSR_PR));
BUG_ON(!FULL_REGS(regs));
Expand Down Expand Up @@ -338,7 +338,7 @@ notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned
unsigned long flags;
unsigned long ret = 0;

if (IS_ENABLED(CONFIG_PPC_BOOK3S))
if (!IS_ENABLED(CONFIG_BOOKE) && !IS_ENABLED(CONFIG_40x))
BUG_ON(!(regs->msr & MSR_RI));
BUG_ON(!(regs->msr & MSR_PR));
BUG_ON(!FULL_REGS(regs));
Expand Down Expand Up @@ -436,7 +436,8 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsign
unsigned long amr;
#endif

if (IS_ENABLED(CONFIG_PPC_BOOK3S) && unlikely(!(regs->msr & MSR_RI)))
if (!IS_ENABLED(CONFIG_BOOKE) && !IS_ENABLED(CONFIG_40x) &&
unlikely(!(regs->msr & MSR_RI)))
unrecoverable_exception(regs);
BUG_ON(regs->msr & MSR_PR);
BUG_ON(!FULL_REGS(regs));
Expand Down

0 comments on commit c01b916

Please sign in to comment.