powerpc: Hardware breakpoints rewrite to handle non DABR breakpoint registers
This is a rewrite so that we don't assume we are using the DABR throughout the code. We now use the arch_hw_breakpoint to store the breakpoint in a generic manner in the thread_struct, rather than storing the raw DABR value. The ptrace GET/SET_DEBUGREG interface currently passes the raw DABR in from userspace. We keep this functionality, so that future changes (like the POWER8 DAWR), will still fake the DABR to userspace. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:

committed by
Benjamin Herrenschmidt

parent
a8190a59e7
commit
9422de3e95
@@ -198,7 +198,7 @@ static int kgdb_iabr_match(struct pt_regs *regs)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int kgdb_dabr_match(struct pt_regs *regs)
|
||||
static int kgdb_break_match(struct pt_regs *regs)
|
||||
{
|
||||
if (user_mode(regs))
|
||||
return 0;
|
||||
@@ -458,7 +458,7 @@ static void *old__debugger;
|
||||
static void *old__debugger_bpt;
|
||||
static void *old__debugger_sstep;
|
||||
static void *old__debugger_iabr_match;
|
||||
static void *old__debugger_dabr_match;
|
||||
static void *old__debugger_break_match;
|
||||
static void *old__debugger_fault_handler;
|
||||
|
||||
int kgdb_arch_init(void)
|
||||
@@ -468,7 +468,7 @@ int kgdb_arch_init(void)
|
||||
old__debugger_bpt = __debugger_bpt;
|
||||
old__debugger_sstep = __debugger_sstep;
|
||||
old__debugger_iabr_match = __debugger_iabr_match;
|
||||
old__debugger_dabr_match = __debugger_dabr_match;
|
||||
old__debugger_break_match = __debugger_break_match;
|
||||
old__debugger_fault_handler = __debugger_fault_handler;
|
||||
|
||||
__debugger_ipi = kgdb_call_nmi_hook;
|
||||
@@ -476,7 +476,7 @@ int kgdb_arch_init(void)
|
||||
__debugger_bpt = kgdb_handle_breakpoint;
|
||||
__debugger_sstep = kgdb_singlestep;
|
||||
__debugger_iabr_match = kgdb_iabr_match;
|
||||
__debugger_dabr_match = kgdb_dabr_match;
|
||||
__debugger_break_match = kgdb_break_match;
|
||||
__debugger_fault_handler = kgdb_not_implemented;
|
||||
|
||||
return 0;
|
||||
@@ -489,6 +489,6 @@ void kgdb_arch_exit(void)
|
||||
__debugger_bpt = old__debugger_bpt;
|
||||
__debugger_sstep = old__debugger_sstep;
|
||||
__debugger_iabr_match = old__debugger_iabr_match;
|
||||
__debugger_dabr_match = old__debugger_dabr_match;
|
||||
__debugger_breakx_match = old__debugger_break_match;
|
||||
__debugger_fault_handler = old__debugger_fault_handler;
|
||||
}
|
||||
|
Reference in New Issue
Block a user