Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/watchpoint/ptrace: Introduce PPC_DEBUG_FEATURE_DATA_BP_ARCH_31

PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 can be used to determine whether
we are running on an ISA 3.1 compliant machine. Which is needed to
determine DAR behaviour, 512 byte boundary limit etc. This was
requested by Pedro Miraglia Franco de Carvalho for extending
watchpoint features in gdb. Note that availability of 2nd DAWR is
independent of this flag and should be checked using
ppc_debug_info->num_data_bps.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200902042945.129369-8-ravi.bangoria@linux.ibm.com

authored by

Ravi Bangoria and committed by
Michael Ellerman
fa725cc5 58da5984

+4
+1
Documentation/powerpc/ptrace.rst
··· 46 46 #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 47 47 #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 48 48 #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 49 + #define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 0x20 49 50 50 51 2. PTRACE_SETHWDEBUG 51 52
+1
arch/powerpc/include/uapi/asm/ptrace.h
··· 222 222 #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x0000000000000004 223 223 #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x0000000000000008 224 224 #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x0000000000000010 225 + #define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 0x0000000000000020 225 226 226 227 #ifndef __ASSEMBLY__ 227 228
+2
arch/powerpc/kernel/ptrace/ptrace-noadv.c
··· 57 57 } else { 58 58 dbginfo->features = 0; 59 59 } 60 + if (cpu_has_feature(CPU_FTR_ARCH_31)) 61 + dbginfo->features |= PPC_DEBUG_FEATURE_DATA_BP_ARCH_31; 60 62 } 61 63 62 64 int ptrace_get_debugreg(struct task_struct *child, unsigned long addr,