>From shaggy at linux.vnet.ibm.com Tue Jan 19 08:57:04 2010 From: shaggy at linux.vnet.ibm.com (Dave Kleikamp) Date: Mon, 18 Jan 2010 14:57:04 -0700 Subject: [RFC:PATCH 00/03] powerpc: Expose BookE debug registers through extended ptrace interface Message-ID: <20100118215704.15684.60646.sendpatch...@norville.austin.ibm.com>
> These patches implement an extention to the ptrace interface proposed by > Thiago Bauermann and the the PowerPC gdb team. (Using the plain text from mail archive..mail may not be in the usual mail-reply format...kindly bear). Hi, First of all, thanks for bringing this patch that puts the debug registers in BookE to good use! I learnt about this patch submission only recently...please see some of my concerns as under. Given that there now exists generic kernel interfaces to use hw-breakpoints - register_user_hw_breakpoint() and unregister_hw_breakpoint() (available in mainline since 2.6.33-rc1), it would be prudent to use them for the ptrace requests (that are made in arch_ptrace()). This would mean that some of the arch-specific debug register code that read/write from/to the debug registers of Book-E may have to be in a form that closely resembles arch/<x86><power>/kernel/hw_breakpoint.c A patch that enables arch-specific code for PPC64 is already submitted (linuxppc-dev ref: 20100121084640.ga3...@in.ibm.com). This converts ptrace requests for PTRACE_<GET><SET>_DEBUGREG flags to use the above-mentioned interfaces for PPC64. If you intend to re-write this patch to use the generic hw-breakpoint interfaces (which I strongly recommend you to do, for the reasons mentioned below), I would be more than glad to help you port them. Some of the benefits of using these generic interfaces include: - Interoperability with other users of debug register (such as parallel kernel requests) i.e. non-exclusive use of debug registers. - Enables debugging/tracing tools such as perf-events and ftrace to make use of debug registers. - Re-use of common code available in kernel (kernel/hw_breakpoint.c). Let me know what you think. Thanks, K.Prasad _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev