mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][GIT PULL] x86/function-graph: fix constraint for recording old return value
@ 2009-05-13 18:04 Steven Rostedt
  2009-05-15 14:42 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2009-05-13 18:04 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Frederic Weisbecker, Andrew Morton, stable


Ingo,

After upgrading my distcc boxes from gcc 4.2.2 to 4.4.0, function graph 
tracer broke. Seems that the variable "old" needs to be denoted as an 
"early clobber". I've put this against the urgent tree and I'm Cc'ing 
stable because by the time 30 (and other) kernels get to users, they may 
be using gcc 4.4.0. I would expect that we will get more complaints about 
this as more people start using the newer gcc.

-- Steve


Please pull the latest tip/tracing/urgent tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/urgent


Steven Rostedt (1):
      x86/function-graph: fix constraint for recording old return value

----
 arch/x86/kernel/ftrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---------------------------
commit aa512a27e9e8ed32f31b15eec67ab1ceca33839b
Author: Steven Rostedt <srostedt@redhat.com>
Date:   Wed May 13 13:52:19 2009 -0400

    x86/function-graph: fix constraint for recording old return value
    
    After upgrading from gcc 4.2.2 to 4.4.0, the function graph tracer broke.
    Investigating, I found that in the asm that replaces the return value,
    gcc was using the same register for the old value as it was for the
    new value.
    
    	mov	(addr), old
    	mov	new, (addr)
    
    But if old and new are the same register, we clobber new with old!
    I first thought this was a bug in gcc 4.4.0 and reported it:
    
      http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40132
    
    Andrew Pinski responded (quickly), saying that it was correct gcc behavior
    and the code needed to denote old as an "early clobber".
    
    Instead of "=r"(old), we need "=&r"(old).
    
    [Impact: keep function graph tracer from breaking with gcc 4.4.0 ]
    
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 18dfa30..b79c553 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -442,7 +442,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
 		_ASM_EXTABLE(1b, 4b)
 		_ASM_EXTABLE(2b, 4b)
 
-		: [old] "=r" (old), [faulted] "=r" (faulted)
+		: [old] "=&r" (old), [faulted] "=r" (faulted)
 		: [parent] "r" (parent), [return_hooker] "r" (return_hooker)
 		: "memory"
 	);


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

* Re: [PATCH][GIT PULL] x86/function-graph: fix constraint for recording old return value
  2009-05-13 18:04 [PATCH][GIT PULL] x86/function-graph: fix constraint for recording old return value Steven Rostedt
@ 2009-05-15 14:42 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2009-05-15 14:42 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Frederic Weisbecker, Andrew Morton, stable


* Steven Rostedt <rostedt@goodmis.org> wrote:

> Ingo,
> 
> After upgrading my distcc boxes from gcc 4.2.2 to 4.4.0, function 
> graph tracer broke. Seems that the variable "old" needs to be 
> denoted as an "early clobber". I've put this against the urgent 
> tree and I'm Cc'ing stable because by the time 30 (and other) 
> kernels get to users, they may be using gcc 4.4.0. I would expect 
> that we will get more complaints about this as more people start 
> using the newer gcc.
> 
> -- Steve
> 
> 
> Please pull the latest tip/tracing/urgent tree, which can be found at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/tracing/urgent
> 
> 
> Steven Rostedt (1):
>       x86/function-graph: fix constraint for recording old return value
> 
> ----
>  arch/x86/kernel/ftrace.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Pulled, thanks Steve!

	Ingo

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

end of thread, other threads:[~2009-05-15 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-13 18:04 [PATCH][GIT PULL] x86/function-graph: fix constraint for recording old return value Steven Rostedt
2009-05-15 14:42 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®