From: Steven Rostedt <rostedt@goodmis.org>
To: Petr Mladek <pmladek@suse.cz>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Jan Beulich <jbeulich@suse.com>, Jiri Kosina <jkosina@suse.cz>,
linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH] ftrace/x86: Use kernel identity mapping only when CONFIG_DEBUG_RODATA enabled
Date: Wed, 4 Jun 2014 14:37:28 -0400 [thread overview]
Message-ID: <20140604143728.22e8cbf5@gandalf.local.home> (raw)
In-Reply-To: <1401896566-8028-1-git-send-email-pmladek@suse.cz>
On Wed, 4 Jun 2014 17:42:46 +0200
Petr Mladek <pmladek@suse.cz> wrote:
> This is just a tiny optimization. The remapping is not needed when the
> kernel text mapping is read write all the time.
This is true, but I think I rather have it still do it the same. The
less variables in the code modification the better. The more changes
per config option, the less things tend to get tested.
This is a micro optimization to something that is hardly a fast path.
-- Steve
>
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Petr Mladek <pmladek@suse.cz>
> ---
> arch/x86/kernel/ftrace.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
> index cbc4a91b131e..a7a517bb793e 100644
> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -79,6 +79,7 @@ within(unsigned long addr, unsigned long start, unsigned long end)
>
> static unsigned long text_ip_addr(unsigned long ip)
> {
> +#ifdef CONFIG_DEBUG_RODATA
> /*
> * On x86_64, kernel text mappings are mapped read-only with
> * CONFIG_DEBUG_RODATA. So we use the kernel identity mapping instead
> @@ -89,7 +90,7 @@ static unsigned long text_ip_addr(unsigned long ip)
> */
> if (within(ip, (unsigned long)_text, (unsigned long)_etext))
> ip = (unsigned long)__va(__pa_symbol(ip));
> -
> +#endif
> return ip;
> }
>
next prev parent reply other threads:[~2014-06-04 18:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 15:42 Petr Mladek
2014-06-04 18:37 ` Steven Rostedt [this message]
2014-06-05 9:14 ` Petr Mládek
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=20140604143728.22e8cbf5@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=fweisbec@gmail.com \
--cc=jbeulich@suse.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=pmladek@suse.cz \
--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
all inboxes | Powered by JetHome®