aboutsummaryrefslogtreecommitdiffstats
path: root/arch/riscv/kernel/vmlinux.lds.S
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2020-03-17 18:11:39 -0700
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-03-31 11:25:50 -0700
commite011995e826f85fbe55dc7d4ce649461163d1052 (patch)
tree1c65250470e736044cf4c6d4554b3f93c5d50c68 /arch/riscv/kernel/vmlinux.lds.S
parentRISC-V: Implement new SBI v0.2 extensions (diff)
downloadlinux-dev-e011995e826f85fbe55dc7d4ce649461163d1052.tar.xz
linux-dev-e011995e826f85fbe55dc7d4ce649461163d1052.zip
RISC-V: Move relocate and few other functions out of __init
The secondary hart booting and relocation code are under .init section. As a result, it will be freed once kernel booting is done. However, ordered booting protocol and CPU hotplug always requires these functions to be present to bringup harts after initial kernel boot. Move the required functions to a different section and make sure that they are in memory within first 2MB offset as trampoline page directory only maps first 2MB. Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/kernel/vmlinux.lds.S')
-rw-r--r--arch/riscv/kernel/vmlinux.lds.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 4ad3c8eb241d..435cd60dca04 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -11,6 +11,7 @@
#include <asm/thread_info.h>
#include <asm/set_memory.h>
+#include <linux/sizes.h>
OUTPUT_ARCH(riscv)
ENTRY(_start)
@@ -21,8 +22,10 @@ SECTIONS
/* Beginning of code and text segment */
. = LOAD_OFFSET;
_start = .;
- __init_begin = .;
HEAD_TEXT_SECTION
+ . = ALIGN(PAGE_SIZE);
+
+ __init_begin = .;
INIT_TEXT_SECTION(PAGE_SIZE)
INIT_DATA_SECTION(16)
/* we have to discard exit text and such at runtime, not link time */