All of lore.kernel.org
 help / color / mirror / Atom feed
From: rusty@rustcorp.com.au (Rusty Russell)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] kernel/kallsyms.c: only show legal kernel symbol
Date: Fri, 25 Oct 2013 09:38:19 +1030	[thread overview]
Message-ID: <87mwlyclng.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20131024084559.GD16735@n2100.arm.linux.org.uk>

Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> On Thu, Oct 24, 2013 at 11:51:18AM +1030, Rusty Russell wrote:
>> Ming Lei <tom.leiming@gmail.com> writes:
>> > 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.
>> 
>> This fix looks hacky; if these symbols are not available, don't just
>> remove them from /proc/kallsyms, but don't put them in the kernel at
>> all.
>
> How do you "don't put them in the kernel at all" when they're used by
> the kernel internally as offsets?

Sorry, I was imprecise.  I was referring to the kernel's kallsyms
tables produced by scripts/kallsyms.c.  This patch left them in the
the kallsyms tables and filtered them out from /proc/kallsyms.

It's weird that cpu_v7_suspend_size appeared above, since kallsyms
should filter out 'A' symbols already.

> If you mean, just get rid of them, shall I just add these as magic
> numbers instead based on the values in this email?  Is that really a
> sane solution?
>
> No, we have to keep these symbols IMHO.

Can you make them absolute symbols?  That should Just Work for kallsyms.

Cheers,
Rusty.

WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Ming Lei <tom.leiming@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Chen Gang <gang.chen@asianux.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH] kernel/kallsyms.c: only show legal kernel symbol
Date: Fri, 25 Oct 2013 09:38:19 +1030	[thread overview]
Message-ID: <87mwlyclng.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20131024084559.GD16735@n2100.arm.linux.org.uk>

Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> On Thu, Oct 24, 2013 at 11:51:18AM +1030, Rusty Russell wrote:
>> Ming Lei <tom.leiming@gmail.com> writes:
>> > 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.
>> 
>> This fix looks hacky; if these symbols are not available, don't just
>> remove them from /proc/kallsyms, but don't put them in the kernel at
>> all.
>
> How do you "don't put them in the kernel at all" when they're used by
> the kernel internally as offsets?

Sorry, I was imprecise.  I was referring to the kernel's kallsyms
tables produced by scripts/kallsyms.c.  This patch left them in the
the kallsyms tables and filtered them out from /proc/kallsyms.

It's weird that cpu_v7_suspend_size appeared above, since kallsyms
should filter out 'A' symbols already.

> If you mean, just get rid of them, shall I just add these as magic
> numbers instead based on the values in this email?  Is that really a
> sane solution?
>
> No, we have to keep these symbols IMHO.

Can you make them absolute symbols?  That should Just Work for kallsyms.

Cheers,
Rusty.

  parent reply	other threads:[~2013-10-24 23:08 UTC|newest]

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

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=87mwlyclng.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.