Re: [PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2011-08-26 Thread K.Prasad
On Wed, Aug 24, 2011 at 01:59:39PM +1000, David Gibson wrote: > On Tue, Aug 23, 2011 at 02:55:13PM +0530, K.Prasad wrote: > > On Tue, Aug 23, 2011 at 03:08:50PM +1000, David Gibson wrote: > > > On Fri, Aug 19, 2011 at 01:21:36PM +0530, K.Prasad wrote: > > >

Re: [PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2011-09-16 Thread K.Prasad
On Fri, Aug 26, 2011 at 03:05:52PM +0530, K.Prasad wrote: > On Wed, Aug 24, 2011 at 01:59:39PM +1000, David Gibson wrote: > > On Tue, Aug 23, 2011 at 02:55:13PM +0530, K.Prasad wrote: > > > On Tue, Aug 23, 2011 at 03:08:50PM +1000, David Gibson wrote: > > > > On F

Re: [PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2011-10-12 Thread K.Prasad
On Wed, Oct 12, 2011 at 02:33:59PM +1100, David Gibson wrote: > On Fri, Sep 16, 2011 at 12:57:10PM +0530, K.Prasad wrote: > > On Fri, Aug 26, 2011 at 03:05:52PM +0530, K.Prasad wrote: > > > On Wed, Aug 24, 2011 at 01:59:39PM +1000, David Gibson wrote: > > > > On T

Re: [PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2011-12-01 Thread K.Prasad
On Mon, Nov 28, 2011 at 02:11:11PM +1100, David Gibson wrote: > [snip] > On Wed, Oct 12, 2011 at 11:09:48PM +0530, K.Prasad wrote: > > > > + if (bp) { > > > > + attr = bp->attr; > > > > + attr.bp_addr = (unsigned long)

Re: [PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2011-12-08 Thread K.Prasad
On Wed, Dec 07, 2011 at 05:01:57PM -0200, Thiago Jung Bauermann wrote: > On Thu, 2011-12-01 at 15:50 +0530, K.Prasad wrote: > > On Mon, Nov 28, 2011 at 02:11:11PM +1100, David Gibson wrote: > > > [snip] > > > On Wed, Oct 12, 2011 at 11:09:48PM +0530, K.Prasad

[PATCH 0/2] Changes to PowerPC ptrace flags using watchpoints - v2

2011-12-08 Thread K.Prasad
. Request an delete, followed by set breakpoint request instead. Thanks, K.Prasad ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2011-12-08 Thread K.Prasad
of the variable can be specified). Signed-off-by: K.Prasad --- Documentation/powerpc/ptrace.txt | 16 arch/powerpc/kernel/ptrace.c | 77 +++--- 2 files changed, 87 insertions(+), 6 deletions(-) diff --git a/Documentation/powerpc/ptrace.txt b

[PATCH 2/2] [PowerPC Book3E] Introduce new ptrace debug feature flag

2011-12-08 Thread K.Prasad
tures" member of "struct ppc_debug_info" to advertise support for the same on Book3E PowerPC processors. Signed-off-by: K.Prasad --- arch/powerpc/include/asm/ptrace.h |1 + arch/powerpc/kernel/ptrace.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/

Re: [PATCH 2/2] [PowerPC Book3E] Introduce new ptrace debug feature flag

2011-12-22 Thread K.Prasad
On Wed, Dec 21, 2011 at 11:55:02AM +1100, David Gibson wrote: > On Thu, Dec 08, 2011 at 04:53:30PM +0530, K.Prasad wrote: > > While PPC_PTRACE_SETHWDEBUG ptrace flag in PowerPC accepts > > PPC_BREAKPOINT_MODE_EXACT mode of breakpoint, the same is not intimated to > > the >

[Patch][hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2012-05-11 Thread K.Prasad
h for inclusion into the relevant PowerPC tree. Thanks, K.Prasad -- PPC_PTRACE_GETHWDBGINFO, PPC_PTRACE_SETHWDEBUG and PPC_PTRACE_DELHWDEBUG are PowerPC specific ptrace flags that use the watchpoint register. While they are targeted primarily towards BookE users, user-space applications such a

Re: [Patch][hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2012-05-14 Thread K.Prasad
On Mon, May 14, 2012 at 10:53:42AM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2012-05-11 at 14:13 +0530, K.Prasad wrote: > > > +#ifdef CONFIG_HAVE_HW_BREAKPOINT > > + int ret, len = 0; > > + struct thread_struct *thread = &(child->thread); > > +

Re: ppc_set_hwdebug vs ptrace_set_debugreg

2010-11-28 Thread K.Prasad
eakpoint() to be used for these new ptrace flags? Thanks, K.Prasad ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: ppc_set_hwdebug vs ptrace_set_debugreg

2010-11-30 Thread K.Prasad
On Mon, Nov 29, 2010 at 11:15:51AM +0100, Andreas Schwab wrote: > "K.Prasad" writes: > > > Although ppc_set_hwdebug() can set DABR through set_dabr() in > > arch/powerpc/kernel/process.c, it is good to have it converted to use > > register_user_hw_breakpoint()

Re: ppc_set_hwdebug vs ptrace_set_debugreg

2010-12-13 Thread K.Prasad
On Wed, Dec 01, 2010 at 10:07:58AM +0530, K.Prasad wrote: > On Mon, Nov 29, 2010 at 11:15:51AM +0100, Andreas Schwab wrote: > > "K.Prasad" writes: > > > > > Although ppc_set_hwdebug() can set DABR through set_dabr() in > > > arch/powerpc/kernel/proces

Re: ppc_set_hwdebug vs ptrace_set_debugreg

2010-12-14 Thread K.Prasad
On Mon, Dec 13, 2010 at 08:05:36PM +0100, Andreas Schwab wrote: > "K.Prasad" writes: > > > +#ifdef CONFIG_HAVE_HW_BREAKPOINT > > + /* Create a new breakpoint request if one doesn't exist already */ > > + hw_breakpoint_init(&attr); > > + at

Re: ppc_set_hwdebug vs ptrace_set_debugreg

2011-01-02 Thread K.Prasad
On Thu, Dec 16, 2010 at 06:07:47PM +0100, Andreas Schwab wrote: > "K.Prasad" writes: > > > How about the revised patch below? It is only compile-tested; have you > > got a quick test case that I can run? > > It crashes the kernel when running the watch-vfork

Re: [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()

2011-02-06 Thread K.Prasad
On Mon, Feb 07, 2011 at 09:54:13AM +1100, Benjamin Herrenschmidt wrote: > A typo in the #ifdef statement makes us never call it > in flush_thread() > I wish it never compiled for such typos :-) > Signed-off-by: Benjamin Herrenschmidt Acked-by: K.Prasad > --- > > diff

Re: [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()

2011-02-06 Thread K.Prasad
On Mon, Feb 07, 2011 at 02:10:39PM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2011-02-07 at 08:26 +0530, K.Prasad wrote: > > On Mon, Feb 07, 2011 at 09:54:13AM +1100, Benjamin Herrenschmidt wrote: > > > A typo in the #ifdef statement makes us never call it >

Re: [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()

2011-02-10 Thread K.Prasad
On Mon, Feb 07, 2011 at 04:13:37PM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2011-02-07 at 10:22 +0530, K.Prasad wrote: > > Okay! Another wrapper of "#ifndef CONFIG_HAVE_HW_BREAKPOINT" around > > the > > definition of 'set_debug_reg_defaults'. &g

[Patch 0/6] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver IX

2009-09-03 Thread K.Prasad
s now aware of 'cpumask' in 'struct hw_breakpoint' and can accomodate requests for a subset of CPUs in the system. - Introduced arch_disable_hw_breakpoint() required for _hw_breakpoint() APIs. Kindly let me know your comments on the same. Thanks, K.Prasad Changelog - ver VI

[Patch 1/6] PPC64-HWBKPT: Prepare the PowerPC platform for HW Breakpoint infrastructure

2009-09-03 Thread K.Prasad
Prepare the PowerPC code for HW Breakpoint infrastructure patches by including relevant constant definitions and function declarations. Signed-off-by: K.Prasad --- arch/powerpc/include/asm/hw_breakpoint.h | 61 +++ arch/powerpc/include/asm/processor.h |1

[Patch 2/6] PPC64-HWBKPT: Introduce PPC64 specific Hardware Breakpoint interfaces

2009-09-03 Thread K.Prasad
Introduce PPC64 implementation for the generic hardware breakpoint interfaces defined in kernel/hw_breakpoint.c. Enable the HAVE_HW_BREAKPOINT flag and the Makefile. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig|1 arch/powerpc/kernel/Makefile|2 arch

[Patch 3/6] PPC64-HWBKPT: Modify ptrace code to use Hardware Breakpoint interfaces

2009-09-03 Thread K.Prasad
Modify the ptrace code to use the hardware breakpoint interfaces for user-space. Signed-off-by: K.Prasad --- arch/powerpc/kernel/ptrace.c | 43 +++ 1 file changed, 43 insertions(+) Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/ptrace.c

[Patch 4/6] PPC64-HWBKPT: Modify process/processor code to recognise hardware debug registers

2009-09-03 Thread K.Prasad
Modify process handling code to recognise hardware debug registers during copy and flush operations. Introduce a new TIF_DEBUG task flag to indicate a process's use of debug register. Load the debug register values into a new CPU during initialisation. Signed-off-by: K.Prasad --- arch/po

[Patch 5/6] PPC64-HWBKPT: Modify Data storage exception code to recognise DABR match first

2009-09-03 Thread K.Prasad
Modify Data storage exception code to first lookout for a DABR match before recognising a kprobe or xmon exception. Signed-off-by: K.Prasad --- arch/powerpc/mm/fault.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) Index: linux-2.6-tip.hbkpt/arch/powerpc/mm/fault.c

[Patch 6/6] PPC64-HWBKPT: Adapt kexec and samples code to recognise PPC64 hw-breakpoint

2009-09-03 Thread K.Prasad
Modify kexec code to disable DABR registers before a reboot. Adapt the samples code to populate PPC64-arch specific fields. Signed-off-by: K.Prasad --- arch/powerpc/kernel/machine_kexec_64.c |3 +++ samples/hw_breakpoint/data_breakpoint.c |4 2 files changed, 7 insertions

[Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver X

2009-12-11 Thread K.Prasad
using ksym_tracer and watchpoints over GDB and are found to work fine. Kindly let me know your comments at the earliest to expedite their upstream integration. Thanks, K.Prasad Changelog - ver IX --- - Invocation of user-defined callback will be 'trigger-after-execute' (exce

[Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2009-12-11 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PPC64 processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/hw_breakpoint.h | 55

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2009-12-14 Thread K.Prasad
x27; integration, ensuring a one-shot behaviour might also have its own bunch of undesirable consequences (such as circular locks), that must be overcome. Unless I see a way to re-instate the breakpoints (surviving a pre-emption), I will send out a new patch that resorts to a one-shot behaviour f

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2009-12-17 Thread K.Prasad
ion. > As stated above, I was worried about a pre-emption happening between a return from breakpoint exception handler and the execution of the causative instructionbut as I learn, it seems fine now. It is just that the kernel code needs to be tweaked keeping this in mind. Thanks, K.Prasad

[Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XI

2010-01-19 Thread K.Prasad
duration and need for pre-emption disable following hw-breakpoint exception. Looking forward for your comments. Thanks, K.Prasad Changelog - ver X -- - Re-write the PPC64 patches for the new implementation of hw-breakpoints that uses the perf-layer. - Rebased to commit

[Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-01-19 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PPC64 processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/hw_breakpoint.h | 55

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-01-19 Thread K.Prasad
On Fri, Dec 18, 2009 at 12:33:20AM +0530, K.Prasad wrote: > On Mon, Dec 14, 2009 at 11:26:26AM -0800, Roland McGrath wrote: > > What remains less than clear is how preemption relates. For any per-thread > > hw_breakpoint, there is no high-level reason to care one way or the other.

[Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XII

2010-01-21 Thread K.Prasad
exception. - User-space instructions are not emulated from kernel-space, they are instead single-stepped. Looking forward for your comments. Thanks, K.Prasad Changelog - ver XI -- (Version X: linuxppc-dev ref: 20091211160144.ga23...@in.ibm.com) - Conditionally unset MSR_SE in the

[Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-01-21 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PPC64 processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/hw_breakpoint.h | 55

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-01-21 Thread K.Prasad
-breakpoint is processed (linuxppc-dev ref: 20100121084640.ga3...@in.ibm.com). It does lead to clumsiness (due to the new variables to track states, prior breakpoints, etc.) but with the reasons you pointed out, it is much better than having uncertain/incorrect code. Thanks for your comments. -

Re: [RFC:PATCH 00/03] powerpc: Expose BookE debug registers through extended ptrace interface

2010-01-24 Thread K.Prasad
gister (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. T

Re: [RFC:PATCH 00/03] powerpc: Expose BookE debug registers through extended ptrace interface

2010-01-27 Thread K.Prasad
On Mon, Jan 25, 2010 at 07:32:00AM +1100, Benjamin Herrenschmidt wrote: > On Mon, 2010-01-25 at 00:48 +0530, K.Prasad wrote: > > > > Some of the benefits of using these generic interfaces include: > > - Interoperability with other users of debug register (such as >

[Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XIII

2010-02-14 Thread K.Prasad
user-space breakpoints (triggered following the failure of a breakpoint request) causing data exception (due to access of NULL/spurious address). - Re-based on commit 724e6d3fe8003c3f60bf404bf22e4e331327c596 of linux-2.6 Thanks, K.Prasad Changelog - ver XII (Version XI

[Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-02-14 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PPC64 processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/hw_breakpoint.h | 55

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-02-22 Thread K.Prasad
On Sun, Feb 21, 2010 at 02:01:37AM +0100, Frederic Weisbecker wrote: > On Mon, Feb 15, 2010 at 11:29:14AM +0530, K.Prasad wrote: > > +struct arch_hw_breakpoint { > > + u8 len; /* length of the target symbol */ > > + int type; > > + char

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-02-23 Thread K.Prasad
On Mon, Feb 22, 2010 at 06:47:46PM +0530, K.Prasad wrote: > On Sun, Feb 21, 2010 at 02:01:37AM +0100, Frederic Weisbecker wrote: > > On Mon, Feb 15, 2010 at 11:29:14AM +0530, K.Prasad wrote: [snipped] > > Also, do you think addr/len/type is enough to abstract out > >

[Patch 0/1] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XIV

2010-03-08 Thread K.Prasad
addition of comments in hw_breakpoint_handler() and single_step_dabr_instruction(). - Re-based to commit 25cf84cf377c0aae5dbcf937ea89bc7893db5176 of linux-2.6 Thanks, K.Prasad Changelog - ver XIII (Version XII: linuxppc-dev ref: 20100121084640.ga3...@in.ibm.com) - Fixed a bug for

[Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-03-08 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PPC64 processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/hw_breakpoint.h | 54

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-03-08 Thread K.Prasad
On Fri, Feb 26, 2010 at 02:58:12AM +0100, Frederic Weisbecker wrote: > On Mon, Feb 22, 2010 at 06:47:46PM +0530, K.Prasad wrote: > > The 'name' field here is actually a legacy inherited from x86 code. It > > is part of x86's arch-specific hw-breakpoint structure since

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-03-14 Thread K.Prasad
> > if (!user_mode(regs) && (address >= TASK_SIZE)) > > return SIGSEGV; > > > > -#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) > > - if (error_code & DSISR_DABRMATCH) { > > - /* DABR match */ > > - do_dabr(regs, address, error_code); > > - return 0; > > - } > > -#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/ > > - > > if (in_atomic() || mm == NULL) { > > if (!user_mode(regs)) > > return SIGSEGV; > > Index: linux-2.6.ppc64_test/arch/powerpc/include/asm/processor.h > > === > > --- linux-2.6.ppc64_test.orig/arch/powerpc/include/asm/processor.h > > +++ linux-2.6.ppc64_test/arch/powerpc/include/asm/processor.h > > @@ -209,6 +209,12 @@ struct thread_struct { > > #ifdef CONFIG_PPC64 > > unsigned long start_tb; /* Start purr when proc switched in */ > > unsigned long accum_tb; /* Total accumilated purr for process */ > > + struct perf_event *ptrace_bps[HBP_NUM]; > > So you should probably call that MAX_HW_BREAKPOINTS and reflect the fact > that it can be bigger. Or you have a pointer to some optional ptrace > BP structure that handle what is needed, and can be allocated lazily > by ptrace only when needed rather than always carrying this around in > the thread_struct. > Since ptrace's request for debug registers are thread-specific, they are stored in 'struct thread_struct' (and is analogous to its implementation in x86). In fact previous attempts to store such values outside thread_struct were discouraged by the LKML community (refer Ingo's mail on LKML here: 20090310143543.ge3...@elte.hu) citing potential locking issues when stored outside. > > + /* > > +* Point to the hw-breakpoint last. Helps safe pre-emption and > > +* hw-breakpoint re-enablement. > > +*/ > > + struct perf_event *last_hit_ubp; > > The comment doesn't make much sense. Preemption doesn't seem quite right > to me unless I missed something and the comment is either too much or > not enough to understand what this is for. > The single-step exception may arise due to two reasons - (a) a legitimate user (like kgdb in kernel-, or ptrace in user-space) decides to single-step for debugging purposes or (b) single-stepping enabled by hw_breakpoint_handler() to restore the debug register values. 'last_hit_ubp' along with 'per_cpu(last_hit_bp)' are used to distinguish single-step exceptions that are triggered because of (b). These data structures will not be required if pre-emption between hw_breakpoint_handler() and single-step exception is disabled, since it will be straight-forward to distinguish the source of exception i.e. (a) from (b). In such a case, with pre-emption disabled on the CPU that hit the breakpoint, single-step exceptions following a hw_breakpoint_handler() will always be the result of (b) and vice-versa. I will make the comment more descriptive as below: /* * Helps identify source of single-step exception and subsequent * hw-breakpoint enablement */ Thank you for the detailed review - they have helped unearth certain important issues with the patch. As stated before, I will send a subsequent version of the patch with the fixes as agreed above. Thanks, K.Prasad ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-03-23 Thread K.Prasad
On Tue, Mar 23, 2010 at 04:33:01PM +1100, Paul Mackerras wrote: > On Mon, Mar 08, 2010 at 11:44:48PM +0530, K.Prasad wrote: > > > @@ -479,6 +483,7 @@ struct task_struct *__switch_to(struct t > > old_thread->accum_tb += (current_tb - start_tb); > >

[RFC Patch 0/2] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XV

2010-03-23 Thread K.Prasad
code comments as per community reviews for previous version. - Minor coding-style changes in hw_breakpoint.c as per review comments. - Re-based to commit ae6be51ed01d6c4aaf249a207b4434bc7785853b of linux-2.6 Thanks, K.Prasad Changelog - ver XIV (Version XIII: linuxppc-dev ref

[RFC Patch 1/2] PPC64-HWBKPT: Disable interrupts for data breakpoint exceptions

2010-03-23 Thread K.Prasad
Data address breakpoint exceptions are currently handled along with page-faults which require interrupts to remain in enabled state. Since exception handling for data breakpoints aren't pre-empt safe, we handle them separately. Signed-off-by: K.Prasad --- arch/powerpc/kernel/exceptions-

[RFC Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-03-23 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PPC64 processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/cputable.h |7

Re: [RFC Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-03-29 Thread K.Prasad
On Fri, Mar 26, 2010 at 04:11:45PM -0500, Dave Kleikamp wrote: > On Tue, 2010-03-23 at 19:37 +0530, K.Prasad wrote: > > plain text document attachment (ppc64_hbkpt_02) > > Implement perf-events based hw-breakpoint interfaces for PPC64 processors. > > These interfaces help ar

[Patch 0/2] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XVI

2010-03-30 Thread K.Prasad
exceptions in DSISR finally (after check for other causes) + changes in code comments and representation of DSISR_DABRMATCH constant. - Rebased to commit ae6be51ed01d6c4aaf249a207b4434bc7785853b of linux-2.6. Let me know if you have any comments. Thanks, K.Prasad Changelog - ver XV

[Patch 1/2] PPC64-HWBKPT: Disable interrupts for data breakpoint exceptions

2010-03-30 Thread K.Prasad
Data address breakpoint exceptions are currently handled along with page-faults which require interrupts to remain in enabled state. Since exception handling for data breakpoints aren't pre-empt safe, we handle them separately. Signed-off-by: K.Prasad --- arch/powerpc/kernel/exceptions-

[Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-03-30 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PPC64 processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/cputable.h |4

Re: [RFC Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-03-30 Thread K.Prasad
On Mon, Mar 29, 2010 at 02:53:36PM -0500, Dave Kleikamp wrote: > On Mon, 2010-03-29 at 17:01 +0530, K.Prasad wrote: > > On Fri, Mar 26, 2010 at 04:11:45PM -0500, Dave Kleikamp wrote: > > > On Tue, 2010-03-23 at 19:37 +0530, K.Prasad wrote: > > > > plain text docum

Re: [RFC Patch 1/2] PPC64-HWBKPT: Disable interrupts for data breakpoint exceptions

2010-03-30 Thread K.Prasad
On Tue, Mar 30, 2010 at 04:24:42PM +1100, Paul Mackerras wrote: > On Tue, Mar 23, 2010 at 07:37:02PM +0530, K.Prasad wrote: > > > Index: linux-2.6.ppc64_test/arch/powerpc/kernel/exceptions-64s.S > > ===

Re: [RFC Patch 1/2] PPC64-HWBKPT: Disable interrupts for data breakpoint exceptions

2010-03-30 Thread K.Prasad
On Tue, Mar 30, 2010 at 04:32:25PM +1100, Benjamin Herrenschmidt wrote: > On Tue, 2010-03-30 at 16:24 +1100, Paul Mackerras wrote: > > On Tue, Mar 23, 2010 at 07:37:02PM +0530, K.Prasad wrote: > > > > > Index: linux-2.6.ppc64_test/arch/powerpc

[Patch 0/2] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XVII

2010-04-13 Thread K.Prasad
. Thanks, K.Prasad Changelog - ver XVI (Version XV: linuxppc-dev ref: 20100323140639.ga21...@in.ibm.com) - Used a new config option CONFIG_PPC_BOOK3S_64 (in lieu of CONFIG_PPC64/CPU_FTR_HAS_DABR) to limit the scope of the new code. - Disabled breakpoints before kexec of the

[Patch 1/2] PPC64-HWBKPT: Disable interrupts for data breakpoint exceptions

2010-04-13 Thread K.Prasad
Data address breakpoint exceptions are currently handled along with page-faults which require interrupts to remain in enabled state. Since exception handling for data breakpoints aren't pre-empt safe, we handle them separately. Signed-off-by: K.Prasad --- arch/powerpc/kernel/exceptions-

[Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-04-13 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PPC64 processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/cputable.h |4

Re: [Patch 1/1] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-04-13 Thread K.Prasad
limited to scope using CONFIG_HAVE_HW_BREAKPOINT. At this stage, I didnot find a need for a seperate CONFIG_HW_BREAKPOINTS though. 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

[RFC Patch 0/1] [hw-bkpt BookE] hw-breakpoint interfaces for BookE - ver I

2010-04-27 Thread K.Prasad
BookS code intergration (hw_breakpoint.c and hw_breakpoint_booke.c) - Code clean-up and reduction. Kindly let me know about comments/suggestions, if any. Thank You, K.Prasad ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.

[RFC Patch 1/1] Implement hw-breakpoint interfaces for BookE processors

2010-04-27 Thread K.Prasad
Implement hardware breakpoint interfaces for PowerPC BookE processors Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |2 arch/powerpc/include/asm/cputable.h|4 arch/powerpc/include/asm/hw_breakpoint_booke.h | 42 +++ arch/powerpc/kernel

Re: [Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-05-04 Thread K.Prasad
On Mon, May 03, 2010 at 04:23:30PM +1000, Paul Mackerras wrote: > On Wed, Apr 14, 2010 at 09:18:27AM +0530, K.Prasad wrote: > > > Implement perf-events based hw-breakpoint interfaces for PPC64 processors. > > These interfaces help arbitrate requests from various users and sch

[Patch 0/3] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XVIII

2010-05-11 Thread K.Prasad
handlers; causes single_step_dabr_instruction() to be invoked after alignment_exception. - SIGTRAP is no longer generated for non-ptrace user-space breakpoints. - Slight code restructuring for brevity and style corrections. Kindly accept them to be a part of -next tree. Thanks, K.Prasad Changelog

[Patch 1/3] PPC64-HWBKPT: Disable interrupts for data breakpoint exceptions

2010-05-11 Thread K.Prasad
Data address breakpoint exceptions are currently handled along with page-faults which require interrupts to remain in enabled state. Since exception handling for data breakpoints aren't pre-empt safe, we handle them separately. Signed-off-by: K.Prasad Acked-by: Paul Mackerras --- arch/po

[Patch 2/3] Allow arch-specific cleanup before breakpoint unregistration

2010-05-11 Thread K.Prasad
Certain architectures (such as PowerPC Book III S) have a need to cleanup data-structures before the breakpoint is unregistered. This patch introduces an arch-specific hook in release_bp_slot() along with a weak definition in the form of a stub funciton. Signed-off-by: K.Prasad --- kernel

[Patch 3/3] PPC64-HWBKPT: Implement hw-breakpoints for PowerPC Book III S

2010-05-11 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PowerPC Book III S processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm

Re: [Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-05-11 Thread K.Prasad
On Wed, May 05, 2010 at 02:03:03AM +0530, K.Prasad wrote: > On Mon, May 03, 2010 at 04:23:30PM +1000, Paul Mackerras wrote: > > On Wed, Apr 14, 2010 at 09:18:27AM +0530, K.Prasad wrote: > > [snipped] > > It has been pointed out to me before (Roland's mail Ref

Re: [PATCH 3/5] powerpc, hw_breakpoints: Fix racy access to ptrace breakpoints

2011-04-24 Thread K.Prasad
> + return -ESRCH; > ret = ptrace_set_debugreg(child, addr, data); > + ptrace_put_breakpoints(child); > break; > > #ifdef CONFIG_PPC64 > -- > 1.7.3.2 > Hi Frederic, Looks fine to me. Acked-by: K.Prasad Thanks, K.Prasad __

Re: [PATCH 2/6] hw_breakpoints: Migrate breakpoint conditional build under new config

2011-07-04 Thread K.Prasad
kpoint patches modular has always been a goal. I've looked at the PowerPC parts of the code and they look harmless. Acked-by: K.Prasad Thanks, K.Prasad ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 4/6] hw_breakpoints: Breakpoints arch ability don't need perf events

2011-07-04 Thread K.Prasad
ptions isn't very clear to me (and is a bit confusing with very similar names). Why not make HAVE_HW_BREAKPOINT selectable by the user (which in turn would turn on PERF_EVENTS) for a given architecture? Thanks, K.Prasad ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/6] hw_breakpoints: Migrate breakpoint conditional build under new config

2011-07-04 Thread K.Prasad
On Mon, Jul 04, 2011 at 03:29:14PM +0200, Frederic Weisbecker wrote: > On Mon, Jul 04, 2011 at 06:57:46PM +0530, K.Prasad wrote: > > On Tue, May 24, 2011 at 11:52:23PM +0200, Frederic Weisbecker wrote: > > > Migrate conditional hw_breakpoint code compilation under > > >

[PATCH 0/2] Changes to PowerPC ptrace flags using watchpoints

2011-08-19 Thread K.Prasad
began using the PPC_PTRACE_GETHWDBGINFO/PPC_PTRACE_SETHWDEBUG/PPC_PTRACE_DELHWDEBUG flags on BookS processors is presently unable to set watchpoints. The changes in Patch1, will fix that issue and help it use a common set of code across BookE and BookS. K.Prasad (2): [hw-breakpoint] Use generic hw

[PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2011-08-19 Thread K.Prasad
nior Barbosa Machado Signed-off-by: K.Prasad --- Documentation/powerpc/ptrace.txt | 16 ++ arch/powerpc/kernel/ptrace.c | 104 +++--- 2 files changed, 112 insertions(+), 8 deletions(-) diff --git a/Documentation/powerpc/ptrace.txt b/Documentation/powerpc/ptra

[PATCH 2/2] [PowerPC Book3E] Introduce new ptrace debug feature flag

2011-08-19 Thread K.Prasad
tures" member of "struct ppc_debug_info" to advertise support for the same on Book3E PowerPC processors. Signed-off-by: K.Prasad --- arch/powerpc/include/asm/ptrace.h |1 + arch/powerpc/kernel/ptrace.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff

Re: [PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags

2011-08-23 Thread K.Prasad
On Tue, Aug 23, 2011 at 03:08:50PM +1000, David Gibson wrote: > On Fri, Aug 19, 2011 at 01:21:36PM +0530, K.Prasad wrote: > > PPC_PTRACE_GETHWDBGINFO, PPC_PTRACE_SETHWDEBUG and PPC_PTRACE_DELHWDEBUG are > > PowerPC specific ptrace flags that use the watchpoint register. Whil

Re: [PATCH 2/2] [PowerPC Book3E] Introduce new ptrace debug feature flag

2011-08-23 Thread K.Prasad
On Tue, Aug 23, 2011 at 03:09:31PM +1000, David Gibson wrote: > On Fri, Aug 19, 2011 at 01:23:38PM +0530, K.Prasad wrote: > > > > While PPC_PTRACE_SETHWDEBUG ptrace flag in PowerPC accepts > > PPC_BREAKPOINT_MODE_EXACT mode of breakpoint, the same is not intimated to &

Re: [Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-05-13 Thread K.Prasad
On Wed, May 12, 2010 at 04:32:47PM +1000, Paul Mackerras wrote: > On Wed, May 05, 2010 at 02:03:03AM +0530, K.Prasad wrote: > > > It is true that the breakpoint exceptions will go amiss following the > > alignment exception, and be restored when the thread single-steps due >

Re: [Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-05-19 Thread K.Prasad
On Mon, May 17, 2010 at 10:32:41PM +1000, Paul Mackerras wrote: > On Fri, May 14, 2010 at 12:25:31PM +0530, K.Prasad wrote: > > > Okay. I will re-use single_step_exception() after modifications; it > > appearsto have no in-kernel users for it. > > It's called from ex

[RFC Patch 0/5] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XIX

2010-05-23 Thread K.Prasad
based to commit f4b87dee923342505e1ddba8d34ce9de33e75050, thereby necessitating minor changes to arch_validate_hwbkpt_settings(). Thanks, K.Prasad Changelog - ver XVIII (Version XVII: linuxppc-dev ref: 20100414034340.ga6...@in.ibm.com) - hw-breakpoint restoration variables are cl

[RFC Patch 1/5] Allow arch-specific cleanup before breakpoint unregistration

2010-05-23 Thread K.Prasad
Certain architectures (such as PowerPC Book III S) have a need to cleanup data-structures before the breakpoint is unregistered. This patch introduces an arch-specific hook in release_bp_slot() along with a weak definition in the form of a stub funciton. Signed-off-by: K.Prasad --- kernel

[RFC Patch 2/5] PPC64-HWBKPT: Implement hw-breakpoints for PowerPC Book III S

2010-05-23 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PowerPC Book III S processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm

[RFC Patch 3/5] PPC64-HWBKPT: Handle concurrent alignment interrupts

2010-05-23 Thread K.Prasad
An alignment interrupt may intervene between a DSI/hw-breakpoint exception and the single-step exception. Enable the alignment interrupt (through modifications to emulate_single_step()) to notify the single-step exception handler for proper restoration of hw-breakpoints. Signed-off-by: K.Prasad

[RFC Patch 4/5] PPC64-HWBKPT: Enable hw-breakpoints while handling intervening signals

2010-05-23 Thread K.Prasad
red in the signal handler (causing loss of MSR_SE). Side-effect: 'Double-hit' of breakpoint if the instruction pointer is unaltered in the new context. Signed-off-by: K.Prasad --- arch/powerpc/include/asm/hw_breakpoint.h |3 +++ arch/powerpc/kernel/hw_brea

[RFC Patch 5/5] PPC64-HWBKPT: Enable proper distinction of per-task and per-cpu breakpoints

2010-05-23 Thread K.Prasad
This helps seamless handling of kernel-space breakpoints within the context of a user-space process and breakpoints for kernel-threads. Signed-off-by: K.Prasad --- arch/powerpc/kernel/hw_breakpoint.c | 24 +--- include/linux/perf_event.h |1 + kernel/pe

Re: [RFC Patch 2/5] PPC64-HWBKPT: Implement hw-breakpoints for PowerPC Book III S

2010-05-23 Thread K.Prasad
On Mon, May 24, 2010 at 09:32:25AM +0530, K.Prasad wrote: > Implement perf-events based hw-breakpoint interfaces for PowerPC Book III S > processors. These interfaces help arbitrate requests from various users and > schedules them as appropriate. > > +/* > + * Hand

[Patch 2/4] PPC64-HWBKPT: Implement hw-breakpoints for PowerPC Book III S

2010-05-24 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PowerPC Book III S processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm

[Patch 3/4] PPC64-HWBKPT: Handle concurrent alignment interrupts

2010-05-24 Thread K.Prasad
An alignment interrupt may intervene between a DSI/hw-breakpoint exception and the single-step exception. Enable the alignment interrupt (through modifications to emulate_single_step()) to notify the single-step exception handler for proper restoration of hw-breakpoints. Signed-off-by: K.Prasad

[Patch 4/4] PPC64-HWBKPT: Enable hw-breakpoints while handling intervening signals

2010-05-24 Thread K.Prasad
red in the signal handler (causing loss of MSR_SE). Side-effect: 'Double-hit' of breakpoint if the instruction pointer is unaltered in the new context. Signed-off-by: K.Prasad --- arch/powerpc/include/asm/hw_breakpoint.h |3 +++ arch/powerpc/kernel/hw_brea

[Patch 0/4] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XX

2010-05-24 Thread K.Prasad
oints will only be emulated. Breakpoint will be unregistered with a warning if emulation fails. Thanks, K.Prasad Changelog - ver XIX (Version XVIII: linuxppc-dev ref: 20100512033055.ga6...@in.ibm.com) - Increased coverage of breakpoints during concurrent alignment_exception

[Patch 1/4] Allow arch-specific cleanup before breakpoint unregistration

2010-05-24 Thread K.Prasad
Certain architectures (such as PowerPC Book III S) have a need to cleanup data-structures before the breakpoint is unregistered. This patch introduces an arch-specific hook in release_bp_slot() along with a weak definition in the form of a stub funciton. Signed-off-by: K.Prasad --- kernel

Re: [Patch 2/2] PPC64-HWBKPT: Implement hw-breakpoints for PPC64

2010-05-24 Thread K.Prasad
On Thu, May 20, 2010 at 11:10:03PM +1000, Paul Mackerras wrote: > On Thu, May 20, 2010 at 09:36:03AM +0530, K.Prasad wrote: > (Had this mail composed along with the patchset...but mail server issues caused delay in sending this...) Hi Paul, While we continue to discuss some of the

[Patch 0/4] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XXI

2010-05-25 Thread K.Prasad
x27;t have to be cleared during sigreturn. A 'double-hit' on hw_breakpoint_handler() is harmless for non-ptrace instructions. - Minor changes to enhance code brevity. Kindly let me know your comments. Thanks, K.Prasad Changelog - ver XX (Version XIX: l

[Patch 1/4] Allow arch-specific cleanup before breakpoint unregistration

2010-05-25 Thread K.Prasad
Certain architectures (such as PowerPC Book III S) have a need to cleanup data-structures before the breakpoint is unregistered. This patch introduces an arch-specific hook in release_bp_slot() along with a weak definition in the form of a stub funciton. Signed-off-by: K.Prasad --- kernel

[Patch 2/4] PPC64-HWBKPT: Implement hw-breakpoints for PowerPC BookIII S

2010-05-25 Thread K.Prasad
Implement perf-events based hw-breakpoint interfaces for PowerPC Book III S processors. These interfaces help arbitrate requests from various users and schedules them as appropriate. Signed-off-by: K.Prasad --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm

[Patch 3/4] PPC64-HWBKPT: Handle concurrent alignment interrupts

2010-05-25 Thread K.Prasad
An alignment interrupt may intervene between a DSI/hw-breakpoint exception and the single-step exception. Enable the alignment interrupt (through modifications to emulate_single_step()) to notify the single-step exception handler for proper restoration of hw-breakpoints. Signed-off-by: K.Prasad

[Patch 4/4] PPC64-HWBKPT: Enable hw-breakpoints while handling intervening signals

2010-05-25 Thread K.Prasad
delivery. Restore hw-breakpoints if the user-context is altered in the signal handler. Signed-off-by: K.Prasad --- arch/powerpc/include/asm/hw_breakpoint.h |2 ++ arch/powerpc/kernel/hw_breakpoint.c | 16 arch/powerpc/kernel/signal.c |3 +++ arch

Re: [Patch 1/4] Allow arch-specific cleanup before breakpoint unregistration

2010-05-25 Thread K.Prasad
On Tue, May 25, 2010 at 06:39:19AM -0500, Millton Miller wrote: > On Tue, 25 May 2010 at 14:43:56 +0530, K.Prasad wrote: > > Certain architectures (such as PowerPC Book III S) have a need to cleanup > > data-structures before the breakpoint is unregistered. This patch introdu

Re: [Patch 1/4] Allow arch-specific cleanup before breakpoint unregistration

2010-05-26 Thread K.Prasad
On Wed, May 26, 2010 at 10:54:41AM +0100, David Howells wrote: > K.Prasad wrote: > > > > My understanding is weak function definitions must appear in a different C > > > file than their call sites to work on some toolchains. > > > > > > > Atleast

  1   2   >