OSDN Git Service

UPSTREAM: MIPS: traps: Correct the SIGTRAP debug ABI in `do_watch' and `do_trap_or_bp'
authorMaciej W. Rozycki <macro@imgtec.com>
Fri, 4 Mar 2016 01:44:28 +0000 (01:44 +0000)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 5 Feb 2018 16:58:31 +0000 (08:58 -0800)
commita8955d815ec71515ff5d658efc08a0f65f63eb4d
tree26856c91662cea5054b0496894a24633e1d162f0
parent23080a1ef201305a9017dd3a116bf07ead7d597e
UPSTREAM: MIPS: traps: Correct the SIGTRAP debug ABI in `do_watch' and `do_trap_or_bp'

Follow our own rules set in <asm/siginfo.h> for SIGTRAP signals issued
from `do_watch' and `do_trap_or_bp' by setting the signal code to
TRAP_HWBKPT and TRAP_BRKPT respectively, for Watch exceptions and for
those Breakpoint exceptions whose originating BREAK instruction's code
does not have a special meaning.  Keep Trap exceptions unaffected as
these are not debug events.

No existing user software is expected to examine signal codes for these
signals as SI_KERNEL has been always used here.  This change makes the
MIPS port more like other Linux ports, which reduces the complexity and
provides for performance improvement in GDB.

Signed-off-by: Maciej W. Rozycki <macro@imgtec.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Luis Machado <lgustavo@codesourcery.com>
Cc: linux-mips@linux-mips.org
Cc: gdb@sourceware.org
Patchwork: https://patchwork.linux-mips.org/patch/12758/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
(cherry picked from commit 3b143cca6e1397188f507a6c727f4108861ceb8b)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
arch/mips/include/asm/mips-r2-to-r6-emul.h
arch/mips/kernel/mips-r2-to-r6-emul.c
arch/mips/kernel/traps.c