]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/modules: Module CRC relocation fix causes perf issues
authorAnton Blanchard <anton@samba.org>
Mon, 15 Jul 2013 04:04:50 +0000 (14:04 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 24 Jul 2013 04:18:43 +0000 (14:18 +1000)
commit7458d6d5f927b6ab920d202ddfe9bd2f2e3be188
tree03741ccea436ce357ca9eca42e026eb616621437
parent330404ac1c74bcba8a3e73d4289d98d0acb2f9e9
powerpc/modules: Module CRC relocation fix causes perf issues

Module CRCs are implemented as absolute symbols that get resolved by
a linker script. We build an intermediate .o that contains an
unresolved symbol for each CRC. genksysms parses this .o, calculates
the CRCs and writes a linker script that "resolves" the symbols to
the calculated CRC.

Unfortunately the ppc64 relocatable kernel sees these CRCs as symbols
that need relocating and relocates them at boot. Commit 2d00586d
(module: handle ppc64 relocating kcrctabs when CONFIG_RELOCATABLE=y)
added a hook to reverse the bogus relocations. Part of this patch
created a symbol at 0x0:

# head -2 /proc/kallsyms
0000000000000000 T reloc_start
c000000000000000 T .__start

This reloc_start symbol is causing lots of confusion to perf. It
thinks reloc_start is a massive function that stretches from 0x0 to
0xc000000000000000 and we get various cryptic errors out of perf,
including:

problem incrementing symbol count, skipping event

This patch removes the  reloc_start linker script label and instead
defines it as PHYSICAL_START. We also need to wrap it with
CONFIG_PPC64 because the ppc32 kernel can set a non zero
PHYSICAL_START at compile time and we wouldn't want to subtract
it from the CRCs in that case.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/module.h
arch/powerpc/kernel/vmlinux.lds.S