Re: [External] [PATCH v3 2/2] riscv: kexec_file: Support loading Image binary file
From: Björn Töpel
Date: Thu Apr 10 2025 - 02:42:36 EST
Hey Yunhui!
yunhui cui <cuiyunhui@xxxxxxxxxxxxx> writes:
> Hi Björn,
>
> On Thu, Apr 10, 2025 at 3:31 AM Björn Töpel <bjorn@xxxxxxxxxx> wrote:
...
>> + kbuf.buffer = kernel;
>> + kbuf.bufsz = kernel_len;
>> + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
>> + kbuf.memsz = le64_to_cpu(h->image_size);
>> + kbuf.buf_align = le64_to_cpu(h->text_offset);
>
> It is necessary to ensure that the kernel entry is aligned to
> PMD_SIZE; otherwise, BUG_ON() in setup_vm() will be triggered.
Indeed, and text_offset is that [1]. FWIW, the text_offset name in the
Image has always weird/confusing to me.
Björn
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/kernel/head.S#n47