lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1401896566-8028-1-git-send-email-pmladek@suse.cz>
Date:	Wed,  4 Jun 2014 17:42:46 +0200
From:	Petr Mladek <pmladek@...e.cz>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Jan Beulich <jbeulich@...e.com>, Jiri Kosina <jkosina@...e.cz>,
	linux-kernel@...r.kernel.org, x86@...nel.org,
	Petr Mladek <pmladek@...e.cz>
Subject: [PATCH] ftrace/x86: Use kernel identity mapping only when CONFIG_DEBUG_RODATA enabled

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@...e.com>
Signed-off-by: Petr Mladek <pmladek@...e.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ