aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2013-03-21 16:12:33 -0400
committerMichael Ellerman <michael@ellerman.id.au>2013-04-18 01:59:55 -0400
commit517b7314770c9247ed77bc0591dbeb362603a371 (patch)
treeb5306df74c471c66598922a4baaca75540526d29 /arch
parenta6a058e52a0ce62de84496c9d4b133f2afc61f27 (diff)
powerpc/ptrace: Add DAWR debug feature info for userspace
This adds new debug feature information so that the DAWR can be identified by userspace tools like GDB. Unfortunately the DAWR doesn't sit nicely into the current description that ptrace provides to userspace via struct ppc_debug_info. It doesn't allow for specifying that only some ranges are possible or even the end alignment constraints (DAWR only allows 512 byte wide ranges which can't cross a 512 byte boundary). After talking to Edjunior Machado (GDB ppc developer), it was decided this was the best approach. Just mark it as debug feature DAWR and tools like GDB can internally decide the constraints. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/uapi/asm/ptrace.h1
-rw-r--r--arch/powerpc/kernel/ptrace.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/include/uapi/asm/ptrace.h b/arch/powerpc/include/uapi/asm/ptrace.h
index 66b9ca4ee94a..77d2ed35b111 100644
--- a/arch/powerpc/include/uapi/asm/ptrace.h
+++ b/arch/powerpc/include/uapi/asm/ptrace.h
@@ -211,6 +211,7 @@ struct ppc_debug_info {
211#define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x0000000000000002 211#define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x0000000000000002
212#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x0000000000000004 212#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x0000000000000004
213#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x0000000000000008 213#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x0000000000000008
214#define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x0000000000000010
214 215
215#ifndef __ASSEMBLY__ 216#ifndef __ASSEMBLY__
216 217
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 10ade3c0c88a..3b14d320e69f 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -1644,6 +1644,8 @@ long arch_ptrace(struct task_struct *child, long request,
1644 dbginfo.sizeof_condition = 0; 1644 dbginfo.sizeof_condition = 0;
1645#ifdef CONFIG_HAVE_HW_BREAKPOINT 1645#ifdef CONFIG_HAVE_HW_BREAKPOINT
1646 dbginfo.features = PPC_DEBUG_FEATURE_DATA_BP_RANGE; 1646 dbginfo.features = PPC_DEBUG_FEATURE_DATA_BP_RANGE;
1647 if (cpu_has_feature(CPU_FTR_DAWR))
1648 dbginfo.features |= PPC_DEBUG_FEATURE_DATA_BP_DAWR;
1647#else 1649#else
1648 dbginfo.features = 0; 1650 dbginfo.features = 0;
1649#endif /* CONFIG_HAVE_HW_BREAKPOINT */ 1651#endif /* CONFIG_HAVE_HW_BREAKPOINT */