Hi Simon, Magnus,
When CONFIG_ARM_KERNMEM_PERMS=y and 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 shmobile assembler sources have several
variables that are written to in the .text section, while .text is
mapped read-only after kernel bootup if CONFIG_DEBUG_RODATA=y.
This series fixes this by moving variables from .text to .data.
Note that there's still an issue with shmobile_boot_fn and
shmobile_boot_arg in arch/arm/mach-shmobile/headsmp.S.
So far I didn't manage to fix this (the code and data are copied to
SRAM on some SoCs). However, currently this are harmless, as these are
written during early kernel boot up only, before .text is marked
read-only.
These issues were uncovered by "[PATCH v2] ARM: mm: flip priority of
CONFIG_DEBUG_RODATA". As that patch is planned for queue up (again)
soon, it may be a good idea to queue these fixes for v4.5, to avoid a
dependency with the arm tree.
Tested hard on sh73a0/kzm9g, r8a7791/koelsch.
Tested lighter on emev2/kzm9d[*], r8a73a4/ape6evm, r8a7740/armadillo, and
r8a7779/marzen[*] ([*] = no remote resume).
Thanks!
Geert Uytterhoeven (2):
ARM: shmobile: Move shmobile_scu_base from .text to .data
ARM: shmobile: Move shmobile_smp_{mpidr,fn,arg}[] from .text to .data
arch/arm/mach-shmobile/headsmp-scu.S | 6 ------
arch/arm/mach-shmobile/headsmp.S | 22 ++++++++++++++++------
arch/arm/mach-shmobile/platsmp-scu.c | 3 +++
3 files changed, 19 insertions(+), 12 deletions(-)
--
1.9.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
shmobile_scu_base is being written to, so it doesn't belong in the .text
section. Fix this by moving it from asm .text to C .data, as it's no
longer used from asm code since commit 4f6da36f7edd5790 ("ARM: shmobile:
Remove old SCU boot code").
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/arm/mach-shmobile/headsmp-scu.S | 6 ------
arch/arm/mach-shmobile/platsmp-scu.c | 3 +++
2 files changed, 3 insertions(+), 6 deletions(-)
When CONFIG_ARM_KERNMEM_PERMS=y and 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 .data section.
This requires accessing them through a pointer after virtual to physical
translation.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/arm/mach-shmobile/headsmp.S | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
On Thu, Jan 28, 2016 at 7:04 AM, Geert Uytterhoeven
[off-list ref] wrote:
Hi Simon, Magnus,
When CONFIG_ARM_KERNMEM_PERMS=y and 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 shmobile assembler sources have several
variables that are written to in the .text section, while .text is
mapped read-only after kernel bootup if CONFIG_DEBUG_RODATA=y.
This series fixes this by moving variables from .text to .data.
Note that there's still an issue with shmobile_boot_fn and
shmobile_boot_arg in arch/arm/mach-shmobile/headsmp.S.
So far I didn't manage to fix this (the code and data are copied to
SRAM on some SoCs). However, currently this are harmless, as these are
written during early kernel boot up only, before .text is marked
read-only.
These issues were uncovered by "[PATCH v2] ARM: mm: flip priority of
CONFIG_DEBUG_RODATA". As that patch is planned for queue up (again)
soon, it may be a good idea to queue these fixes for v4.5, to avoid a
dependency with the arm tree.
Tested hard on sh73a0/kzm9g, r8a7791/koelsch.
Tested lighter on emev2/kzm9d[*], r8a73a4/ape6evm, r8a7740/armadillo, and
r8a7779/marzen[*] ([*] = no remote resume).
Thanks!
Geert Uytterhoeven (2):
ARM: shmobile: Move shmobile_scu_base from .text to .data
ARM: shmobile: Move shmobile_smp_{mpidr,fn,arg}[] from .text to .data
arch/arm/mach-shmobile/headsmp-scu.S | 6 ------
arch/arm/mach-shmobile/headsmp.S | 22 ++++++++++++++++------
arch/arm/mach-shmobile/platsmp-scu.c | 3 +++
3 files changed, 19 insertions(+), 12 deletions(-)
--
1.9.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Sergei Shtylyov <hidden> Date: 2016-01-28 15:37:19
Hello.
On 01/28/2016 06:04 PM, Geert Uytterhoeven wrote:
shmobile_scu_base is being written to, so it doesn't belong in the .text
section. Fix this by moving it from asm .text to C .data, as it's no
longer used from asm code since commit 4f6da36f7edd5790 ("ARM: shmobile:
Remove old SCU boot code").
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
From: Nicolas Pitre <hidden> Date: 2016-01-28 16:30:52
On Thu, 28 Jan 2016, Geert Uytterhoeven wrote:
quoted hunk
When CONFIG_ARM_KERNMEM_PERMS=y and 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 .data section.
This requires accessing them through a pointer after virtual to physical
translation.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/arm/mach-shmobile/headsmp.S | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
I always leave two blank lines between different sections, and one blank
line between function or data blocks.
Is that a problem?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Russell King - ARM Linux <hidden> Date: 2016-01-28 17:48:48
On Thu, Jan 28, 2016 at 07:19:34AM -0800, Kees Cook wrote:
On Thu, Jan 28, 2016 at 7:04 AM, Geert Uytterhoeven
[off-list ref] wrote:
quoted
Hi Simon, Magnus,
When CONFIG_ARM_KERNMEM_PERMS=y and 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 shmobile assembler sources have several
variables that are written to in the .text section, while .text is
mapped read-only after kernel bootup if CONFIG_DEBUG_RODATA=y.
This series fixes this by moving variables from .text to .data.
Note that there's still an issue with shmobile_boot_fn and
shmobile_boot_arg in arch/arm/mach-shmobile/headsmp.S.
So far I didn't manage to fix this (the code and data are copied to
SRAM on some SoCs). However, currently this are harmless, as these are
written during early kernel boot up only, before .text is marked
read-only.
These issues were uncovered by "[PATCH v2] ARM: mm: flip priority of
CONFIG_DEBUG_RODATA". As that patch is planned for queue up (again)
soon, it may be a good idea to queue these fixes for v4.5, to avoid a
dependency with the arm tree.
Tested hard on sh73a0/kzm9g, r8a7791/koelsch.
Tested lighter on emev2/kzm9d[*], r8a73a4/ape6evm, r8a7740/armadillo, and
r8a7779/marzen[*] ([*] = no remote resume).
Thanks!
Geert Uytterhoeven (2):
ARM: shmobile: Move shmobile_scu_base from .text to .data
ARM: shmobile: Move shmobile_smp_{mpidr,fn,arg}[] from .text to .data
arch/arm/mach-shmobile/headsmp-scu.S | 6 ------
arch/arm/mach-shmobile/headsmp.S | 22 ++++++++++++++++------
arch/arm/mach-shmobile/platsmp-scu.c | 3 +++
3 files changed, 19 insertions(+), 12 deletions(-)
And I'll be dropping it into linux-next for next week (iow, I'll commit
it tomorrow.)
Unfortunately, -rc1 broke some platforms, so Olof's builder isn't going
to get full coverage of it while building only my tree.
--
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
And I'll be dropping it into linux-next for next week (iow, I'll commit
it tomorrow.)
Unfortunately, -rc1 broke some platforms, so Olof's builder isn't going
to get full coverage of it while building only my tree.
FYI I sent a pull request for the omap related fixes earlier today. So
we should be good to go from that point of view for enabling rodata by
default for v4.6.
Regards,
Tony