linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 0/3] kallsyms: remove special handling for CONFIG_ARM
Date: Tue,  9 Feb 2016 16:13:45 +0100	[thread overview]
Message-ID: <1455030828-6416-1-git-send-email-ard.biesheuvel@linaro.org> (raw)

The kallsyms symbol address table generation contains a workaround for
CONFIG_ARM to address an issue with perf when it sees symbols whose
addresses are close to 0x0. The workaround is only enabled if XIP_KERNEL=n,
not because the issue itself only exists in that case, but because the
chosen workaround cannot deal with [_stext,_etext] living below PAGE_OFFSET.

So let's fix this properly, by emitting the stubs symbols at a more reasonable
offset, which is more likely to be the actual location of the vectors and stubs
sections at runtime, and will prevent the symbols from being mistaken for
userland symbols by perf.

Changes since v3:
- rebased onto -next, which contains a patch that moves the XIP handling to a
  separate linker script (patch #1)
  
Changes since v2:
- Move back to the original arrangement, where .stubs follows .vectors, and both
  are emitted outside of the ordinary kernel VMA space
- Move .vectors and .stubs sections to VMA 0xffff0000/0xffff1000, respectively.
  As Russell pointed out, this is the most reasonable value, since modern CPUs
  actually execute the vectors and stubs from there, and it fixes the kallsyms
  perf issue all the same.
- Rebased onto latest -next, which contains related ARM patch 8514/1, and
  updated kallsyms base relative patches (queued via akpm's tree)

Changes since v1:
- added Nico's ack
- use PROVIDE() for vector_fiq_offset since vector_fiq itself is not always
  defined
- put __stubs_start/_end inside the section definition so that the value of the
  start symbol equals the start of the section after alignment (fixes an issue
  on XIP spotted by Chris)

Patch #1 moves the .stubs and .vectors section back into the kernel VMA, while
preserving the guaranteed virtual offset of 4 KB. This results in all symbols
that kallsyms sees to be in a reasonable interval.

Patch #2 removes the special case for CONFIG_ARM && !CONFIG_XIP_KERNEL in the
invocation of scripts/kallsyms

Patch #3 removes the now unused --page-offset command line argument handling
from scripts/kallsyms.c

Ard Biesheuvel (3):
  ARM: move .vectors and .stubs sections back into the kernel VMA
  kallsyms: remove special lower address limit for CONFIG_ARM
  kallsyms: remove --page-offset command line option

 arch/arm/kernel/entry-armv.S      | 3 +--
 arch/arm/kernel/vmlinux-xip.lds.S | 6 ++++--
 arch/arm/kernel/vmlinux.lds.S     | 6 ++++--
 scripts/kallsyms.c                | 8 --------
 scripts/link-vmlinux.sh           | 4 ----
 5 files changed, 9 insertions(+), 18 deletions(-)

-- 
2.5.0

             reply	other threads:[~2016-02-09 15:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 15:13 Ard Biesheuvel [this message]
2016-02-09 15:13 ` [PATCH v4 1/3] ARM: move .vectors and .stubs sections back into the kernel VMA Ard Biesheuvel
2016-02-09 15:13 ` [PATCH v4 2/3] kallsyms: remove special lower address limit for CONFIG_ARM Ard Biesheuvel
2016-02-09 15:13 ` [PATCH v4 3/3] kallsyms: remove --page-offset command line option Ard Biesheuvel
2016-02-09 16:09   ` Chris Brandt
2016-02-09 16:17     ` Ard Biesheuvel
2016-02-09 19:28       ` Nicolas Pitre
2016-02-09 20:18         ` Ard Biesheuvel
2016-02-09 20:45           ` Nicolas Pitre

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=1455030828-6416-1-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --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 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).