]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Don't mark init section as non-executable
authorAnup Patel <anup.patel@wdc.com>
Mon, 1 Jun 2020 05:06:56 +0000 (10:36 +0530)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Wed, 10 Jun 2020 02:11:26 +0000 (19:11 -0700)
commit0a17578fd93d254f6faacfdd5e6e25a83445e520
tree96404fb2ee2b129c58e4e99261e756dc90e9bdcc
parent4008166a514394ba3889ba235cb9a3895dcdf46a
RISC-V: Don't mark init section as non-executable

The head text section (i.e. _start, secondary_start_sbi, etc) and the
init section fall under same page table level-1 mapping.

Currently, the runtime CPU hotplug is broken because we are marking
init section as non-executable which in-turn marks head text section
as non-executable.

Further investigating other architectures, it seems marking the init
section as non-executable is redundant because the init section pages
are anyway poisoned and freed.

To fix broken runtime CPU hotplug, we simply remove the code marking
the init section as non-executable.

Fixes: ada849e97651 ("riscv: add STRICT_KERNEL_RWX support")
Cc: stable@vger.kernel.org
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Zong Li <zong.li@sifive.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/mm/init.c