diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2016-02-15 07:20:07 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2016-02-17 04:27:21 -0500 |
commit | 4e960f52fce16a3bf3261fa92c34cf2306059ba2 (patch) | |
tree | 673f2e3d6c50814e1801f26e81889ea9e4494ec3 | |
parent | b1568d80123a7e7ab528f587ef6896b2d5413b61 (diff) |
ARM: shmobile: Move shmobile_smp_{mpidr, fn, arg}[] from .text to .bss
If CONFIG_DEBUG_RODATA=y, the kernel crashes during system suspend:
Freezing user space processes ... (elapsed 0.004 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.002 seconds)
done.
PM: suspend of devices complete after 111.948 msecs
PM: late suspend of devices complete after 1.086 msecs
PM: noirq suspend of devices complete after 11.576 msecs
Disabling non-boot CPUs ...
Kernel panic - not syncing: Attempted to kill the idle task!
1014ec ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
CPU0: stopping
This happens because the .text section is marked read-only, while the
arrays shmobile_smp_mpidr[], shmobile_smp_fn[], and shmobile_smp_arg[]
are being written to.
Fix this by moving these arrays from the .text to the .bss section.
This requires accessing them through PC-relative offsets.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/mach-shmobile/headsmp.S | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S index 330c1fc63197..94d86ed16414 100644 --- a/arch/arm/mach-shmobile/headsmp.S +++ b/arch/arm/mach-shmobile/headsmp.S | |||
@@ -50,9 +50,11 @@ ENTRY(shmobile_smp_boot) | |||
50 | mrc p15, 0, r1, c0, c0, 5 @ r1 = MPIDR | 50 | mrc p15, 0, r1, c0, c0, 5 @ r1 = MPIDR |
51 | and r0, r1, r0 @ r0 = cpu_logical_map() value | 51 | and r0, r1, r0 @ r0 = cpu_logical_map() value |
52 | mov r1, #0 @ r1 = CPU index | 52 | mov r1, #0 @ r1 = CPU index |
53 | adr r5, 1f @ array of per-cpu mpidr values | 53 | adr r2, 1f |
54 | adr r6, 2f @ array of per-cpu functions | 54 | ldmia r2, {r5, r6, r7} |
55 | adr r7, 3f @ array of per-cpu arguments | 55 | add r5, r5, r2 @ array of per-cpu mpidr values |
56 | add r6, r6, r2 @ array of per-cpu functions | ||
57 | add r7, r7, r2 @ array of per-cpu arguments | ||
56 | 58 | ||
57 | shmobile_smp_boot_find_mpidr: | 59 | shmobile_smp_boot_find_mpidr: |
58 | ldr r8, [r5, r1, lsl #2] | 60 | ldr r8, [r5, r1, lsl #2] |
@@ -80,12 +82,18 @@ ENTRY(shmobile_smp_sleep) | |||
80 | b shmobile_smp_boot | 82 | b shmobile_smp_boot |
81 | ENDPROC(shmobile_smp_sleep) | 83 | ENDPROC(shmobile_smp_sleep) |
82 | 84 | ||
85 | .align 2 | ||
86 | 1: .long shmobile_smp_mpidr - . | ||
87 | .long shmobile_smp_fn - 1b | ||
88 | .long shmobile_smp_arg - 1b | ||
89 | |||
90 | .bss | ||
83 | .globl shmobile_smp_mpidr | 91 | .globl shmobile_smp_mpidr |
84 | shmobile_smp_mpidr: | 92 | shmobile_smp_mpidr: |
85 | 1: .space NR_CPUS * 4 | 93 | .space NR_CPUS * 4 |
86 | .globl shmobile_smp_fn | 94 | .globl shmobile_smp_fn |
87 | shmobile_smp_fn: | 95 | shmobile_smp_fn: |
88 | 2: .space NR_CPUS * 4 | 96 | .space NR_CPUS * 4 |
89 | .globl shmobile_smp_arg | 97 | .globl shmobile_smp_arg |
90 | shmobile_smp_arg: | 98 | shmobile_smp_arg: |
91 | 3: .space NR_CPUS * 4 | 99 | .space NR_CPUS * 4 |