Skip to content

Commit 49af7a2

Browse files
Torsten Duwepalmer-dabbelt
authored andcommitted
riscv/kexec: load initrd high in available memory
When initrd is loaded low, the secondary kernel fails like this: INITRD: 0xdc581000+0x00eef000 overlaps in-use memory region This initrd load address corresponds to the _end symbol, but the reservation is aligned on PMD_SIZE, as explained by a comment in setup_bootmem(). It is technically possible to align the initrd load address accordingly, leaving a hole between the end of kernel and the initrd, but it is much simpler to allocate the initrd top-down. Fixes: 838b3e2 ("RISC-V: Load purgatory in kexec_file") Signed-off-by: Torsten Duwe <duwe@suse.de> Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com> Cc: stable@vger.kernel.org Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/all/67c8eb9eea25717c2c8208d9bfbfaa39e6e2a1c6.1690365011.git.petr.tesarik.ext@huawei.com/ Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent d0b4f95 commit 49af7a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/riscv/kernel/elf_kexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static void *elf_kexec_load(struct kimage *image, char *kernel_buf,
281281
kbuf.buffer = initrd;
282282
kbuf.bufsz = kbuf.memsz = initrd_len;
283283
kbuf.buf_align = PAGE_SIZE;
284-
kbuf.top_down = false;
284+
kbuf.top_down = true;
285285
kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
286286
ret = kexec_add_buffer(&kbuf);
287287
if (ret)

0 commit comments

Comments
 (0)