All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()
@ 2011-02-06 22:54 Benjamin Herrenschmidt
  2011-02-07  2:56 ` K.Prasad
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2011-02-06 22:54 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: K.Prasad

A typo in the #ifdef statement makes us never call it
in flush_thread()

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 7a1d5cb..c4e4eab 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -670,11 +670,11 @@ void flush_thread(void)
 {
 	discard_lazy_cpu_state();
 
-#ifdef CONFIG_HAVE_HW_BREAKPOINTS
+#ifdef CONFIG_HAVE_HW_BREAKPOINT
 	flush_ptrace_hw_breakpoint(current);
-#else /* CONFIG_HAVE_HW_BREAKPOINTS */
+#else /* CONFIG_HAVE_HW_BREAKPOINT */
 	set_debug_reg_defaults(&current->thread);
-#endif /* CONFIG_HAVE_HW_BREAKPOINTS */
+#endif /* CONFIG_HAVE_HW_BREAKPOINT */
 }
 
 void

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()
  2011-02-06 22:54 [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint() Benjamin Herrenschmidt
@ 2011-02-07  2:56 ` K.Prasad
  2011-02-07  3:10   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 6+ messages in thread
From: K.Prasad @ 2011-02-07  2:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

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 <benh@kernel.crashing.org>
Acked-by: K.Prasad <prasad@linux.vnet.ibm.com>

> ---
> 
> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index 7a1d5cb..c4e4eab 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -670,11 +670,11 @@ void flush_thread(void)
>  {
>  	discard_lazy_cpu_state();
> 
> -#ifdef CONFIG_HAVE_HW_BREAKPOINTS
> +#ifdef CONFIG_HAVE_HW_BREAKPOINT
>  	flush_ptrace_hw_breakpoint(current);
> -#else /* CONFIG_HAVE_HW_BREAKPOINTS */
> +#else /* CONFIG_HAVE_HW_BREAKPOINT */
>  	set_debug_reg_defaults(&current->thread);
> -#endif /* CONFIG_HAVE_HW_BREAKPOINTS */
> +#endif /* CONFIG_HAVE_HW_BREAKPOINT */
>  }
> 
>  void
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()
  2011-02-07  2:56 ` K.Prasad
@ 2011-02-07  3:10   ` Benjamin Herrenschmidt
  2011-02-07  4:52     ` K.Prasad
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2011-02-07  3:10 UTC (permalink / raw)
  To: prasad; +Cc: linuxppc-dev, David Kleikamp

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
> > in flush_thread()
> >
> 
> I wish it never compiled for such typos :-)
> 
>  
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Acked-by: K.Prasad <prasad@linux.vnet.ibm.com>

Interestingly, that 'fix' now breaks the build:

cc1: warnings being treated as errors
/home/benh/linux-powerpc-test/arch/powerpc/kernel/process.c:356: error:
'set_debug_reg_defaults' defined but not used 

This file is is becoming an absolute mess of ifdef's in large part due
to the new BookE debug stuff and your HW breakpoint stuff... Any chance
you and Shaggy see if you can improve that situation a bit ?

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()
  2011-02-07  3:10   ` Benjamin Herrenschmidt
@ 2011-02-07  4:52     ` K.Prasad
  2011-02-07  5:13       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 6+ messages in thread
From: K.Prasad @ 2011-02-07  4:52 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, David Kleikamp

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
> > > in flush_thread()
> > >
> > 
> > I wish it never compiled for such typos :-)
> > 
> >  
> > > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Acked-by: K.Prasad <prasad@linux.vnet.ibm.com>
> 
> Interestingly, that 'fix' now breaks the build:
> 
> cc1: warnings being treated as errors
> /home/benh/linux-powerpc-test/arch/powerpc/kernel/process.c:356: error:
> 'set_debug_reg_defaults' defined but not used 
> 
> This file is is becoming an absolute mess of ifdef's in large part due
> to the new BookE debug stuff and your HW breakpoint stuff... Any chance
> you and Shaggy see if you can improve that situation a bit ?
> 
> Cheers,
> Ben.
> 
> 

Okay! Another wrapper of "#ifndef CONFIG_HAVE_HW_BREAKPOINT" around the
definition of 'set_debug_reg_defaults'.

There's indeed too much sprinkling of #ifdefs in the code, but most of
it would go away when the BookE code also uses the generic hw-breakpoint
interfaces. Given the advanced debug features that BookE supports, it's
unfortunately not that straight-forward (needs additions to generic
hw-breakpoint infrastructure).

Thanks,
K.Prasad

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()
  2011-02-07  4:52     ` K.Prasad
@ 2011-02-07  5:13       ` Benjamin Herrenschmidt
  2011-02-10 14:44         ` K.Prasad
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2011-02-07  5:13 UTC (permalink / raw)
  To: prasad; +Cc: linuxppc-dev, David Kleikamp

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'.

Can you send a patch ?

> There's indeed too much sprinkling of #ifdefs in the code, but most of
> it would go away when the BookE code also uses the generic
> hw-breakpoint interfaces. 

What's your status for those patches ?

> Given the advanced debug features that BookE supports, it's
> unfortunately not that straight-forward (needs additions to generic
> hw-breakpoint infrastructure).

Might want to move a lot of that code to a separate set of files maybe
and just call a single hook from the various process.c locations ?

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint()
  2011-02-07  5:13       ` Benjamin Herrenschmidt
@ 2011-02-10 14:44         ` K.Prasad
  0 siblings, 0 replies; 6+ messages in thread
From: K.Prasad @ 2011-02-10 14:44 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, David Kleikamp

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'.
> 
> Can you send a patch ?
>

Pasted below.
 
> > There's indeed too much sprinkling of #ifdefs in the code, but most of
> > it would go away when the BookE code also uses the generic
> > hw-breakpoint interfaces. 
> 
> What's your status for those patches ?
> 

The last I checked, I knew that the version of patchset I sent out
(linuxppc-dev message id: 20100629165152.GA8586@in.ibm.com)
didn't actually work when tested on hardware (it was just compile tested
before sending). It needs substantial amount of time to get it in shape,
which I'm unfortunately lacking now (plenty of priority items in hand that
needs dedicated attention).

Thanks,
K.Prasad

Fix the error in spelling the config option for hw-breakpoints and fix
the build issue that follows.

Signed-off by: K.Prasad <prasad@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/process.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: linux-2.6.set_hwdebug/arch/powerpc/kernel/process.c
===================================================================
--- linux-2.6.set_hwdebug.orig/arch/powerpc/kernel/process.c
+++ linux-2.6.set_hwdebug/arch/powerpc/kernel/process.c
@@ -353,6 +353,7 @@ static void switch_booke_debug_regs(stru
 			prime_debug_regs(new_thread);
 }
 #else	/* !CONFIG_PPC_ADV_DEBUG_REGS */
+#ifndef CONFIG_HAVE_HW_BREAKPOINT
 static void set_debug_reg_defaults(struct thread_struct *thread)
 {
 	if (thread->dabr) {
@@ -360,6 +361,7 @@ static void set_debug_reg_defaults(struc
 		set_dabr(0);
 	}
 }
+#endif /* !CONFIG_HAVE_HW_BREAKPOINT */
 #endif	/* CONFIG_PPC_ADV_DEBUG_REGS */
 
 int set_dabr(unsigned long dabr)
@@ -670,11 +672,11 @@ void flush_thread(void)
 {
 	discard_lazy_cpu_state();
 
-#ifdef CONFIG_HAVE_HW_BREAKPOINTS
+#ifdef CONFIG_HAVE_HW_BREAKPOINT
 	flush_ptrace_hw_breakpoint(current);
-#else /* CONFIG_HAVE_HW_BREAKPOINTS */
+#else /* CONFIG_HAVE_HW_BREAKPOINT */
 	set_debug_reg_defaults(&current->thread);
-#endif /* CONFIG_HAVE_HW_BREAKPOINTS */
+#endif /* CONFIG_HAVE_HW_BREAKPOINT */
 }
 
 void

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-10 14:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-06 22:54 [PATCH] powerpc: Fix call to flush_ptrace_hw_breakpoint() Benjamin Herrenschmidt
2011-02-07  2:56 ` K.Prasad
2011-02-07  3:10   ` Benjamin Herrenschmidt
2011-02-07  4:52     ` K.Prasad
2011-02-07  5:13       ` Benjamin Herrenschmidt
2011-02-10 14:44         ` K.Prasad

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.