ARM: shmobile: Move shmobile_smp_{mpidr, fn, arg}[] from .text to .bss
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 15 Feb 2016 12:20:07 +0000 (13:20 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Wed, 17 Feb 2016 09:27:21 +0000 (18:27 +0900)
commit4e960f52fce16a3bf3261fa92c34cf2306059ba2
tree673f2e3d6c50814e1801f26e81889ea9e4494ec3
parentb1568d80123a7e7ab528f587ef6896b2d5413b61
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>
arch/arm/mach-shmobile/headsmp.S