Skip to content

Commit 2b29b0d

Browse files
antonblanchardgregkh
authored andcommitted
powerpc/modules: Module CRC relocation fix causes perf issues
commit 0e0ed64 upstream. 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 d4703ae (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 <[email protected]> Acked-by: Rusty Russell <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 85acabe commit 2b29b0d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

arch/powerpc/include/asm/module.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,9 @@ struct exception_table_entry;
8282
void sort_ex_table(struct exception_table_entry *start,
8383
struct exception_table_entry *finish);
8484

85-
#ifdef CONFIG_MODVERSIONS
85+
#if defined(CONFIG_MODVERSIONS) && defined(CONFIG_PPC64)
8686
#define ARCH_RELOCATES_KCRCTAB
87-
88-
extern const unsigned long reloc_start[];
87+
#define reloc_start PHYSICAL_START
8988
#endif
9089
#endif /* __KERNEL__ */
9190
#endif /* _ASM_POWERPC_MODULE_H */

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ jiffies = jiffies_64 + 4;
3838
#endif
3939
SECTIONS
4040
{
41-
. = 0;
42-
reloc_start = .;
43-
4441
. = KERNELBASE;
4542

4643
/*

0 commit comments

Comments
 (0)