From: George Guo <dongtai.guo@linux.dev>
To: rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org,
chenhuacai@kernel.org, ardb@kernel.org, shuah@kernel.org
Cc: ilias.apalodimas@linaro.org, akpm@linux-foundation.org,
baoquan.he@linux.dev, ruirui.yang@linux.dev,
guodongtai@kylinos.cn, kernel@xen0n.name, graf@amazon.com,
liukexin@kylinos.cn, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-efi@vger.kernel.org
Subject: [PATCH v6 8/8] selftests/liveupdate: Add LoongArch vmtest support
Date: Fri, 30 Oct 2026 02:29:55 +0900 [thread overview]
Message-ID: <20261029172956.20791-9-dongtai.guo@linux.dev> (raw)
In-Reply-To: <20261029172956.20791-1-dongtai.guo@linux.dev>
From: George Guo <guodongtai@kylinos.cn>
Add the LoongArch kernel configuration, target and cross-compiler
detection, and include loongarch64 in the VM test suite.
Boot vmlinux.efi through EFI firmware so the EFI stub installs the KHO
table. Allow the firmware path to be set with QEMU_EFI and skip the test
if it is unavailable.
Co-developed-by: Kexin Liu <liukexin@kylinos.cn>
Signed-off-by: Kexin Liu <liukexin@kylinos.cn>
Signed-off-by: George Guo <guodongtai@kylinos.cn>
---
.../selftests/liveupdate/config.loongarch64 | 5 +++++
tools/testing/selftests/liveupdate/run-vmtests.sh | 4 ++--
tools/testing/selftests/liveupdate/vmtest.sh | 14 +++++++++++++-
3 files changed, 20 insertions(+), 3 deletions(-)
create mode 100644 tools/testing/selftests/liveupdate/config.loongarch64
diff --git a/tools/testing/selftests/liveupdate/config.loongarch64 b/tools/testing/selftests/liveupdate/config.loongarch64
new file mode 100644
index 000000000000..264067ef5ab1
--- /dev/null
+++ b/tools/testing/selftests/liveupdate/config.loongarch64
@@ -0,0 +1,5 @@
+CONFIG_ACPI_SPCR_TABLE=y
+CONFIG_PCI_HOST_GENERIC=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SMP=y
diff --git a/tools/testing/selftests/liveupdate/run-vmtests.sh b/tools/testing/selftests/liveupdate/run-vmtests.sh
index d656ce58c5a7..f6cfb76b1dac 100755
--- a/tools/testing/selftests/liveupdate/run-vmtests.sh
+++ b/tools/testing/selftests/liveupdate/run-vmtests.sh
@@ -4,7 +4,7 @@
SCRIPT_DIR=$(dirname "$(realpath "$0")")
TEST_RUNNER="$SCRIPT_DIR/vmtest.sh"
-TARGETS=("x86_64" "aarch64")
+TARGETS=("x86_64" "aarch64" "loongarch64")
GREEN='\033[0;32m'
RED='\033[0;31m'
@@ -72,7 +72,7 @@ function main() {
for test_name in "${TEST_NAMES[@]}"; do
log="$output_dir/${arch}_${test_name}.log"
- printf " -> %-8s %-24s ... " "$arch" "$test_name"
+ printf " -> %-11s %-24s ... " "$arch" "$test_name"
"$TEST_RUNNER" -t "$arch" -T "$test_name" &> "$log"
exit_code=$?
diff --git a/tools/testing/selftests/liveupdate/vmtest.sh b/tools/testing/selftests/liveupdate/vmtest.sh
index 69beda6c961d..ffe82512f3e4 100755
--- a/tools/testing/selftests/liveupdate/vmtest.sh
+++ b/tools/testing/selftests/liveupdate/vmtest.sh
@@ -21,6 +21,12 @@ function get_arch_conf() {
QEMU_CMD="qemu-system-aarch64 -M virt -cpu max"
KERNEL_IMAGE="Image"
KERNEL_CMDLINE="console=ttyAMA0"
+ elif [[ "$arch" == "loongarch" ]]; then
+ local qemu_efi="${QEMU_EFI:-/usr/share/edk2/loongarch64/QEMU_EFI.fd}"
+ [ -r "$qemu_efi" ] || skip "EFI firmware '$qemu_efi' not found, set QEMU_EFI"
+ QEMU_CMD="qemu-system-loongarch64 -M virt -cpu la464 -bios $qemu_efi"
+ KERNEL_IMAGE="vmlinux.efi"
+ KERNEL_CMDLINE="console=ttyS0 earlycon"
elif [[ "$arch" == "x86" ]]; then
QEMU_CMD="qemu-system-x86_64"
KERNEL_IMAGE="bzImage"
@@ -37,11 +43,15 @@ $0 [-d build_dir] [-j jobs] [-t target_arch] [-T test_name] [-w workspace_dir] [
Options:
-d) path to the kernel build directory (default: .luo_test_build.<arch>)
-j) number of jobs for compilation
- -t) run test for target_arch (aarch64, x86_64)
+ -t) run test for target_arch (aarch64, loongarch64, x86_64)
-T) test name to run (default: luo_kexec_simple)
-w) custom workspace directory (default: creates temp dir)
-k) keep workspace directory after successful test
-h) display this help
+
+Environment:
+ QEMU_EFI LoongArch EFI firmware path
+ (default: /usr/share/edk2/loongarch64/QEMU_EFI.fd)
EOF
}
@@ -86,6 +96,7 @@ function detect_cross_compile() {
local candidate=""
case "$target" in
aarch64) candidate="aarch64-linux-gnu-" ;;
+ loongarch64) candidate="loongarch64-linux-gnu-" ;;
x86_64) candidate="x86_64-linux-gnu-" ;;
*) skip "Auto-detection for target '$target' not supported. Please set CROSS_COMPILE manually." ;;
esac
@@ -193,6 +204,7 @@ function target_to_arch() {
local target=$1
case $target in
aarch64) echo "arm64" ;;
+ loongarch64) echo "loongarch" ;;
x86_64) echo "x86" ;;
*) skip "architecture $target is not supported"
esac
--
2.53.0
next prev parent reply other threads:[~2026-10-29 17:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 17:29 [PATCH v6 0/8] LoongArch: Add KHO support and selftests George Guo
2026-10-29 17:29 ` [PATCH v6 1/8] efi: Pass KHO state to the next kernel in a configuration table George Guo
2026-10-29 17:47 ` sashiko-bot
2026-10-29 19:28 ` Ard Biesheuvel
2026-10-29 19:42 ` Pratyush Yadav
2026-10-29 17:29 ` [PATCH v6 2/8] kho: Write KHO state to the EFI table at kexec time George Guo
2026-10-29 17:47 ` sashiko-bot
2026-10-29 17:29 ` [PATCH v6 3/8] kho: Include linux/mm.h in kho_block.c George Guo
2026-10-29 17:47 ` sashiko-bot
2026-10-29 17:29 ` [PATCH v6 4/8] kho: Add kho_disable() George Guo
2026-10-29 17:47 ` sashiko-bot
2026-10-29 17:29 ` [PATCH v6 5/8] LoongArch: Allow memblock arrays to resize George Guo
2026-10-29 17:47 ` sashiko-bot
2026-10-29 17:29 ` [PATCH v6 6/8] LoongArch: Enable kexec handover (KHO) George Guo
2026-10-29 17:47 ` sashiko-bot
2026-10-29 17:29 ` [PATCH v6 7/8] selftests/kho: Add LoongArch vmtest support George Guo
2026-10-29 17:47 ` sashiko-bot
2026-10-29 17:29 ` George Guo [this message]
2026-10-29 17:47 ` [PATCH v6 8/8] selftests/liveupdate: " sashiko-bot
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=20261029172956.20791-9-dongtai.guo@linux.dev \
--to=dongtai.guo@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=chenhuacai@kernel.org \
--cc=graf@amazon.com \
--cc=guodongtai@kylinos.cn \
--cc=ilias.apalodimas@linaro.org \
--cc=kernel@xen0n.name \
--cc=kexec@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liukexin@kylinos.cn \
--cc=loongarch@lists.linux.dev \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=ruirui.yang@linux.dev \
--cc=shuah@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.