Skip to content

Commit 4e0f9e3

Browse files
avpatelpalmer-dabbelt
authored andcommitted
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: d27c3c9 ("riscv: add STRICT_KERNEL_RWX support") Cc: [email protected] Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Zong Li <[email protected]> Reviewed-by: Atish Patra <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent e71ee06 commit 4e0f9e3

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

arch/riscv/mm/init.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -481,17 +481,6 @@ static void __init setup_vm_final(void)
481481
csr_write(CSR_SATP, PFN_DOWN(__pa_symbol(swapper_pg_dir)) | SATP_MODE);
482482
local_flush_tlb_all();
483483
}
484-
485-
void free_initmem(void)
486-
{
487-
unsigned long init_begin = (unsigned long)__init_begin;
488-
unsigned long init_end = (unsigned long)__init_end;
489-
490-
/* Make the region as non-execuatble. */
491-
set_memory_nx(init_begin, (init_end - init_begin) >> PAGE_SHIFT);
492-
free_initmem_default(POISON_FREE_INITMEM);
493-
}
494-
495484
#else
496485
asmlinkage void __init setup_vm(uintptr_t dtb_pa)
497486
{

0 commit comments

Comments
 (0)