All of lore.kernel.org
 help / color / mirror / Atom feed
From: geert+renesas@glider.be (Geert Uytterhoeven)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/2] ARM: shmobile: Move written variables from .text to .data
Date: Thu, 28 Jan 2016 16:04:20 +0100	[thread overview]
Message-ID: <1453993462-12210-1-git-send-email-geert+renesas@glider.be> (raw)

	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

             reply	other threads:[~2016-01-28 15:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 15:04 Geert Uytterhoeven [this message]
2016-01-28 15:04 ` [PATCH 1/2] ARM: shmobile: Move shmobile_scu_base from .text to .data Geert Uytterhoeven
2016-01-28 15:37   ` Sergei Shtylyov
2016-01-28 17:00     ` Geert Uytterhoeven
2016-01-28 15:04 ` [PATCH 2/2] ARM: shmobile: Move shmobile_smp_{mpidr, fn, arg}[] " Geert Uytterhoeven
2016-01-28 16:30   ` [PATCH 2/2] ARM: shmobile: Move shmobile_smp_{mpidr,fn,arg}[] " Nicolas Pitre
2016-01-28 15:19 ` [PATCH 0/2] ARM: shmobile: Move written variables " Kees Cook
2016-01-28 17:48   ` Russell King - ARM Linux
2016-01-28 19:07     ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453993462-12210-1-git-send-email-geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.