Skip to content

Commit e821fa4

Browse files
committed
signal/powerpc: Replace TRAP_FIXME with TRAP_UNK
Using an si_code of 0 that aliases with SI_USER is clearly the wrong thing todo, and causes problems in interesting ways. For use in unknown_exception the recently defined TRAP_UNK semantically is a perfect fit. For use in RunModeException it looks like something more specific than TRAP_UNK could be used. No one has bothered to find a better fit than the broken si_code of 0 in all of these years and I don't see an obvious better fit so TRAP_UNK is switching RunModeException to return TRAP_UNK is clearly an improvement. Recent history suggests no actually cares about crazy corner cases of the kernel behavior like this so I don't expect any regressions from changing this. However if something does happen this change is easy to revert. Though I wonder if SIGKILL might not be a better fit. Cc: Paul Mackerras <paulus@samba.org> Cc: Kumar Gala <kumar.gala@freescale.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: linuxppc-dev@lists.ozlabs.org Fixes: 9bad068 ("[PATCH] ppc32: support for e500 and 85xx") Fixes: 0ed70f6 ("PPC32: Provide proper siginfo information on various exceptions.") History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
1 parent 535906c commit e821fa4

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

‎arch/powerpc/include/uapi/asm/siginfo.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,4 @@
1515

1616
#include <asm-generic/siginfo.h>
1717

18-
/*
19-
* SIGTRAP si_codes
20-
*/
21-
#ifdef __KERNEL__
22-
#define TRAP_FIXME 0 /* Broken dup of SI_USER */
23-
#endif /* __KERNEL__ */
24-
25-
2618
#endif /* _ASM_POWERPC_SIGINFO_H */

‎arch/powerpc/kernel/traps.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ void unknown_exception(struct pt_regs *regs)
969969
printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
970970
regs->nip, regs->msr, regs->trap);
971971

972-
_exception(SIGTRAP, regs, TRAP_FIXME, 0);
972+
_exception(SIGTRAP, regs, TRAP_UNK, 0);
973973

974974
exception_exit(prev_state);
975975
}
@@ -991,7 +991,7 @@ void instruction_breakpoint_exception(struct pt_regs *regs)
991991

992992
void RunModeException(struct pt_regs *regs)
993993
{
994-
_exception(SIGTRAP, regs, TRAP_FIXME, 0);
994+
_exception(SIGTRAP, regs, TRAP_UNK, 0);
995995
}
996996

997997
void single_step_exception(struct pt_regs *regs)

0 commit comments

Comments
 (0)