From: "Björn Töpel" <bjorn@kernel.org>
To: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Song Shuai <songshuaishuai@tinylab.org>,
Daniel Maslowski <cyrevolt@gmail.com>,
linux-riscv@lists.infradead.org
Cc: "Björn Töpel" <bjorn@rivosinc.com>,
"Nick Kossifidis" <mick@ics.forth.gr>,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/2] riscv: kexec_file: Support loading Image binary file
Date: Wed, 9 Apr 2025 21:29:57 +0200 [thread overview]
Message-ID: <20250409193004.643839-1-bjorn@kernel.org> (raw)
From: Björn Töpel <bjorn@rivosinc.com>
Hi!
For over a year ago, Daniel and I was testing the V2 of Song's series.
I also promised to take the V2, that had been sitting on the lists for
too long, to rebase it on a new kernel, and re-test it.
One year later, here's the V3! ;-)
There are no changes from V2 other, than some simple checkpatch
cleanups.
Song's original cover:
| This series makes the kexec_file_load() syscall support to load
| Image binary file. At the same time, corresponding support for
| kexec-tools had been pushed to my repo[2].
|
| Now, we can leverage that kexec-tools and this series to use the
| kexec_load() or kexec_file_load() syscall to boot both vmlinux and
| Image file, as seen in these combo tests:
|
| ```
| 1. kexec -l vmlinux
| 2. kexec -l Image
| 3. kexec -s -l vmlinux
| 4. kexec -s -l Image
| ```
Notably, kexec-tools has still not made it upstream. I've prepared a
branch on my GH [3], that I indend to post ASAP. That branch is a
collection of fixes/features, including Song's userland Image loading.
The V2 is here [2], and V1 [1].
I've tested the kexec-file/Image on qemu-rv64, with following
combinations:
* ACPI/UEFI
* DT/UEFI
* DT
both "regular" kexec (-s + -e), and crashkernels (-p).
Note that there are two purgatory patches that has to be present (part
of -rc1, so all good):
commit 28093cfef5dd ("riscv/kexec_file: Handle R_RISCV_64 in purgatory relocator")
commit 3f7023171df4 ("riscv/purgatory: 4B align purgatory_start")
[1] https://lore.kernel.org/linux-riscv/20230914020044.1397356-1-songshuaishuai@tinylab.org/
[2] https://lore.kernel.org/linux-riscv/20231016092006.3347632-1-songshuaishuai@tinylab.org/
[3] https://github.com/bjoto/kexec-tools/tree/rv-on-master
Song Shuai (2):
riscv: kexec_file: Split the loading of kernel and others
riscv: kexec_file: Support loading Image binary file
arch/riscv/include/asm/image.h | 2 +
arch/riscv/include/asm/kexec.h | 6 +
arch/riscv/kernel/Makefile | 2 +-
arch/riscv/kernel/elf_kexec.c | 485 -------------------------
arch/riscv/kernel/kexec_elf.c | 144 ++++++++
arch/riscv/kernel/kexec_image.c | 96 +++++
arch/riscv/kernel/machine_kexec_file.c | 361 ++++++++++++++++++
7 files changed, 610 insertions(+), 486 deletions(-)
delete mode 100644 arch/riscv/kernel/elf_kexec.c
create mode 100644 arch/riscv/kernel/kexec_elf.c
create mode 100644 arch/riscv/kernel/kexec_image.c
base-commit: a24588245776dafc227243a01bfbeb8a59bafba9
--
2.45.2
next reply other threads:[~2025-04-09 19:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 19:29 Björn Töpel [this message]
2025-04-09 19:29 ` [PATCH v3 1/2] riscv: kexec_file: Split the loading of kernel and others Björn Töpel
2025-04-09 19:29 ` [PATCH v3 2/2] riscv: kexec_file: Support loading Image binary file Björn Töpel
2025-04-10 1:44 ` [External] " yunhui cui
2025-04-10 6:40 ` Björn Töpel
2025-04-16 13:58 ` kernel test robot
2025-06-02 22:12 ` [PATCH v3 0/2] " patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250409193004.643839-1-bjorn@kernel.org \
--to=bjorn@kernel.org \
--cc=alex@ghiti.fr \
--cc=bjorn@rivosinc.com \
--cc=cyrevolt@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mick@ics.forth.gr \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=songshuaishuai@tinylab.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®