]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.4.56/powerpc-modules-module-crc-relocation-fix-causes-perf-issues.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.4.56 / powerpc-modules-module-crc-relocation-fix-causes-perf-issues.patch
1 From 0e0ed6406e61434d3f38fb58aa8464ec4722b77e Mon Sep 17 00:00:00 2001
2 From: Anton Blanchard <anton@samba.org>
3 Date: Mon, 15 Jul 2013 14:04:50 +1000
4 Subject: powerpc/modules: Module CRC relocation fix causes perf issues
5
6 From: Anton Blanchard <anton@samba.org>
7
8 commit 0e0ed6406e61434d3f38fb58aa8464ec4722b77e upstream.
9
10 Module CRCs are implemented as absolute symbols that get resolved by
11 a linker script. We build an intermediate .o that contains an
12 unresolved symbol for each CRC. genksysms parses this .o, calculates
13 the CRCs and writes a linker script that "resolves" the symbols to
14 the calculated CRC.
15
16 Unfortunately the ppc64 relocatable kernel sees these CRCs as symbols
17 that need relocating and relocates them at boot. Commit d4703aef
18 (module: handle ppc64 relocating kcrctabs when CONFIG_RELOCATABLE=y)
19 added a hook to reverse the bogus relocations. Part of this patch
20 created a symbol at 0x0:
21
22 # head -2 /proc/kallsyms
23 0000000000000000 T reloc_start
24 c000000000000000 T .__start
25
26 This reloc_start symbol is causing lots of confusion to perf. It
27 thinks reloc_start is a massive function that stretches from 0x0 to
28 0xc000000000000000 and we get various cryptic errors out of perf,
29 including:
30
31 problem incrementing symbol count, skipping event
32
33 This patch removes the reloc_start linker script label and instead
34 defines it as PHYSICAL_START. We also need to wrap it with
35 CONFIG_PPC64 because the ppc32 kernel can set a non zero
36 PHYSICAL_START at compile time and we wouldn't want to subtract
37 it from the CRCs in that case.
38
39 Signed-off-by: Anton Blanchard <anton@samba.org>
40 Acked-by: Rusty Russell <rusty@rustcorp.com.au>
41 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
42 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
43
44 ---
45 arch/powerpc/include/asm/module.h | 5 ++---
46 arch/powerpc/kernel/vmlinux.lds.S | 3 ---
47 2 files changed, 2 insertions(+), 6 deletions(-)
48
49 --- a/arch/powerpc/include/asm/module.h
50 +++ b/arch/powerpc/include/asm/module.h
51 @@ -87,10 +87,9 @@ struct exception_table_entry;
52 void sort_ex_table(struct exception_table_entry *start,
53 struct exception_table_entry *finish);
54
55 -#ifdef CONFIG_MODVERSIONS
56 +#if defined(CONFIG_MODVERSIONS) && defined(CONFIG_PPC64)
57 #define ARCH_RELOCATES_KCRCTAB
58 -
59 -extern const unsigned long reloc_start[];
60 +#define reloc_start PHYSICAL_START
61 #endif
62 #endif /* __KERNEL__ */
63 #endif /* _ASM_POWERPC_MODULE_H */
64 --- a/arch/powerpc/kernel/vmlinux.lds.S
65 +++ b/arch/powerpc/kernel/vmlinux.lds.S
66 @@ -38,9 +38,6 @@ jiffies = jiffies_64 + 4;
67 #endif
68 SECTIONS
69 {
70 - . = 0;
71 - reloc_start = .;
72 -
73 . = KERNELBASE;
74
75 /*