linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] kernel/kallsyms.c: only show legal kernel symbol
@ 2013-10-23  3:18 Ming Lei
  2013-10-24  1:21 ` Rusty Russell
  0 siblings, 1 reply; 18+ messages in thread
From: Ming Lei @ 2013-10-23  3:18 UTC (permalink / raw)
  To: linux-arm-kernel

Address of non-module kernel symbol should always be located
from CONFIG_PAGE_OFFSET on, so only show these legal kernel
symbols in /proc/kallsyms.

On ARM, some symbols(see below) may drop in relocatable code, so
perf can't parse kernel symbols any more from /proc/kallsyms, this
patch fixes the problem.

	00000000 t __vectors_start
	00000020 A cpu_v7_suspend_size
	00001000 t __stubs_start
	00001004 t vector_rst
	00001020 t vector_irq
	000010a0 t vector_dabt
	00001120 t vector_pabt
	000011a0 t vector_und
	00001220 t vector_addrexcptn
	00001224 t vector_fiq
	00001224 T vector_fiq_offset

The issue can be fixed in scripts/kallsyms.c too, but looks this
approach is easier.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel at lists.infradead.org
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 kernel/kallsyms.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 3127ad5..184f271 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -543,7 +543,7 @@ static int s_show(struct seq_file *m, void *p)
 					tolower(iter->type);
 		seq_printf(m, "%pK %c %s\t[%s]\n", (void *)iter->value,
 			   type, iter->name, iter->module_name);
-	} else
+	} else if (iter->value >= CONFIG_PAGE_OFFSET)
 		seq_printf(m, "%pK %c %s\n", (void *)iter->value,
 			   iter->type, iter->name);
 	return 0;
-- 
1.7.9.5

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

end of thread, other threads:[~2013-11-01  2:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23  3:18 [RFC PATCH] kernel/kallsyms.c: only show legal kernel symbol Ming Lei
2013-10-24  1:21 ` Rusty Russell
2013-10-24  5:42   ` Ming Lei
2013-10-24  8:45   ` Russell King - ARM Linux
2013-10-24  9:10     ` Ming Lei
2013-10-24 23:08     ` Rusty Russell
2013-10-25  1:29       ` Ming Lei
2013-10-25  5:50         ` Rusty Russell
2013-10-25  7:01           ` Ming Lei
2013-10-25 11:58             ` Rusty Russell
2013-10-26 12:31               ` Ming Lei
2013-10-28  3:14                 ` Rusty Russell
2013-10-28  5:23                   ` Ming Lei
2013-10-28  5:50                     ` Rusty Russell
2013-10-30 23:09                       ` Russell King - ARM Linux
2013-10-31  3:14                         ` Rusty Russell
2013-10-31  4:55                           ` Ming Lei
2013-11-01  2:28                             ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).