public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Namhyung Kim <namhyung@kernel.org>, Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	x86@kernel.org, "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [PATCH] ftrace/x86: Fix function graph tracer reset path
Date: Mon, 16 May 2016 21:03:59 +0200	[thread overview]
Message-ID: <20160516190359.GB16265@pd.tnic> (raw)
In-Reply-To: <20160516142453.GB16239@danjae.aot.lge.com>

On Mon, May 16, 2016 at 11:24:53PM +0900, Namhyung Kim wrote:
> > -GLOBAL(ftrace_stub)
> > +/* This is weak to keep gas from relaxing the jumps */
> > +WEAK(ftrace_stub)
> >  	retq
> >  END(ftrace_caller)

You could also force the 5-byte jump. I guess you could also write
simply ".long 0" in there but this way it is more robust if someone
decides to add other stuff between the JMP and the ftrace_stub label.

---
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S
index ed48a9f465f8..b1db8a584c06 100644
--- a/arch/x86/kernel/mcount_64.S
+++ b/arch/x86/kernel/mcount_64.S
@@ -179,7 +179,9 @@ GLOBAL(ftrace_epilogue)
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 GLOBAL(ftrace_graph_call)
-	jmp ftrace_stub
+	.byte 0xe9
+	.long ftrace_stub - 1f
+1:
 #endif
 
 GLOBAL(ftrace_stub)

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

  reply	other threads:[~2016-05-16 19:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 13:53 [PATCH] ftrace/x86: Fix function graph tracer reset path Namhyung Kim
2016-05-13 14:06 ` Steven Rostedt
2016-05-15 21:41   ` Matt Fleming
2016-05-15  0:41 ` Masami Hiramatsu
2016-05-15 13:06   ` Namhyung Kim
     [not found]     ` <20160516175614.53e0ceed3ec0880526fa1799@kernel.org>
2016-05-16 12:32       ` Namhyung Kim
2016-05-16 13:58         ` Steven Rostedt
2016-05-16 14:24           ` Namhyung Kim
2016-05-16 19:03             ` Borislav Petkov [this message]
2016-05-16 19:13               ` Steven Rostedt
2016-05-16 19:19                 ` Borislav Petkov
2016-05-16 19:23                   ` Steven Rostedt
2016-05-16 19:52           ` Matt Fleming
2016-05-16 22:08           ` Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160516190359.GB16265@pd.tnic \
    --to=bp@suse.de \
    --cc=hjl.tools@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox