Skip to content

Commit f806982

Browse files
Merge patch series "RISC-V: Fix a few kexec_file_load(2) failures"
Petr Tesarik <petrtesarik@huaweicloud.com> says: From: Petr Tesarik <petr.tesarik.ext@huawei.com> The kexec_file_load(2) syscall does not work at least in some kernel builds. For details see the relevant section in this blog post: https://sigillatum.tesarici.cz/2023-07-21-state-of-riscv64-kdump.html This patch series handles an additional relocation types, removes the need to implement a Global Offset Table (GOT) for the purgatory and fixes the placement of initrd. * b4-shazam-merge: riscv/kexec: load initrd high in available memory riscv/kexec: handle R_RISCV_CALL_PLT relocation type Link: https://lore.kernel.org/r/cover.1690365011.git.petr.tesarik.ext@huawei.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2 parents 640c503 + 49af7a2 commit f806982

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/riscv/kernel/elf_kexec.c

Lines changed: 2 additions & 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)
@@ -425,6 +425,7 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
425425
* sym, instead of searching the whole relsec.
426426
*/
427427
case R_RISCV_PCREL_HI20:
428+
case R_RISCV_CALL_PLT:
428429
case R_RISCV_CALL:
429430
*(u64 *)loc = CLEAN_IMM(UITYPE, *(u64 *)loc) |
430431
ENCODE_UJTYPE_IMM(val - addr);

0 commit comments

Comments
 (0)