* [PATCH] ftrace/x86: Use kernel identity mapping only when CONFIG_DEBUG_RODATA enabled
@ 2014-06-04 15:42 Petr Mladek
2014-06-04 18:37 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Petr Mladek @ 2014-06-04 15:42 UTC (permalink / raw)
To: Steven Rostedt
Cc: Frederic Weisbecker, Masami Hiramatsu, Jan Beulich, Jiri Kosina,
linux-kernel, x86, Petr Mladek
This is just a tiny optimization. The remapping is not needed when the
kernel text mapping is read write all the time.
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;
}
--
1.8.4
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ftrace/x86: Use kernel identity mapping only when CONFIG_DEBUG_RODATA enabled
2014-06-04 15:42 [PATCH] ftrace/x86: Use kernel identity mapping only when CONFIG_DEBUG_RODATA enabled Petr Mladek
@ 2014-06-04 18:37 ` Steven Rostedt
2014-06-05 9:14 ` Petr Mládek
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2014-06-04 18:37 UTC (permalink / raw)
To: Petr Mladek
Cc: Frederic Weisbecker, Masami Hiramatsu, Jan Beulich, Jiri Kosina,
linux-kernel, x86
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;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ftrace/x86: Use kernel identity mapping only when CONFIG_DEBUG_RODATA enabled
2014-06-04 18:37 ` Steven Rostedt
@ 2014-06-05 9:14 ` Petr Mládek
0 siblings, 0 replies; 3+ messages in thread
From: Petr Mládek @ 2014-06-05 9:14 UTC (permalink / raw)
To: Steven Rostedt
Cc: Frederic Weisbecker, Masami Hiramatsu, Jan Beulich, Jiri Kosina,
linux-kernel, x86
On Wed 2014-06-04 14:37:28, Steven Rostedt wrote:
> 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.
It makes sense. Let's leave it as is.
Best Regards,
Petr
> >
> > 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;
> > }
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-05 9:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-04 15:42 [PATCH] ftrace/x86: Use kernel identity mapping only when CONFIG_DEBUG_RODATA enabled Petr Mladek
2014-06-04 18:37 ` Steven Rostedt
2014-06-05 9:14 ` Petr Mládek
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®