Skip to content

Commit 8a5f78d

Browse files
committed
Merge tag 'riscv-for-linus-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: "Two fixes this week: - A fix to actually reserve the device tree's memory. Without this the device tree can be overwritten on systems that don't otherwise reserve it. This issue should only manifest on !MMU systems. - A workaround for a BUG() that triggers when the memory that originally contained initdata is freed and later repurposed. This triggers a BUG() on builds that had HARDENED_USERCOPY enabled" * tag 'riscv-for-linus-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Fixup bootup failure with HARDENED_USERCOPY RISC-V: Make sure memblock reserves the memory containing DT
2 parents 277e570 + 8481446 commit 8a5f78d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

arch/riscv/kernel/vmlinux.lds.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ SECTIONS
2222
/* Beginning of code and text segment */
2323
. = LOAD_OFFSET;
2424
_start = .;
25-
_stext = .;
2625
HEAD_TEXT_SECTION
2726
. = ALIGN(PAGE_SIZE);
2827

2928
__init_begin = .;
3029
INIT_TEXT_SECTION(PAGE_SIZE)
31-
INIT_DATA_SECTION(16)
3230
. = ALIGN(8);
3331
__soc_early_init_table : {
3432
__soc_early_init_table_start = .;
@@ -55,6 +53,7 @@ SECTIONS
5553
. = ALIGN(SECTION_ALIGN);
5654
.text : {
5755
_text = .;
56+
_stext = .;
5857
TEXT_TEXT
5958
SCHED_TEXT
6059
CPUIDLE_TEXT
@@ -67,6 +66,8 @@ SECTIONS
6766
_etext = .;
6867
}
6968

69+
INIT_DATA_SECTION(16)
70+
7071
/* Start of data section */
7172
_sdata = .;
7273
RO_DATA(SECTION_ALIGN)

arch/riscv/mm/init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
515515
#else
516516
dtb_early_va = (void *)dtb_pa;
517517
#endif
518+
dtb_early_pa = dtb_pa;
518519
}
519520

520521
static inline void setup_vm_final(void)

0 commit comments

Comments
 (0)