Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: George Guo <dongtai.guo@linux.dev>
To: chenhuacai@kernel.org, rppt@kernel.org,
	pasha.tatashin@soleen.com, pratyush@kernel.org
Cc: kernel@xen0n.name, graf@amazon.com, shuah@kernel.org,
	loongarch@lists.linux.dev, kexec@lists.infradead.org,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, George Guo <guodongtai@kylinos.cn>,
	Kexin Liu <liukexin@kylinos.cn>
Subject: [PATCH 5/7] selftests/kho: add LoongArch vmtest support
Date: Mon, 25 May 2026 14:28:08 +0800	[thread overview]
Message-ID: <20260525062810.103367-6-dongtai.guo@linux.dev> (raw)
In-Reply-To: <20260525062810.103367-1-dongtai.guo@linux.dev>

From: George Guo <guodongtai@kylinos.cn>

Add loongarch.conf to configure QEMU's LoongArch virt machine with a
la464 CPU, enable the 8250 serial console, and set the kernel image
to vmlinux.efi. Extend vmtest.sh to recognize loongarch64 as a
supported target and map it to the 'loongarch' kernel arch name.

QEMU's LoongArch virt machine provides no ACPI tables and relies on
FDT to describe hardware. Without 'earlycon' on the kernel command
line, the FDT is not scanned for a console UART, no output reaches
the console, and vmtest.sh's console log stays empty causing the test
to always fail. Add 'earlycon' to KERNEL_CMDLINE in loongarch.conf
to fix this.

Co-developed-by: Kexin Liu <liukexin@kylinos.cn>
Signed-off-by: Kexin Liu <liukexin@kylinos.cn>
Signed-off-by: George Guo <guodongtai@kylinos.cn>
---
 tools/testing/selftests/kho/loongarch.conf | 7 +++++++
 tools/testing/selftests/kho/vmtest.sh      | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/kho/loongarch.conf

diff --git a/tools/testing/selftests/kho/loongarch.conf b/tools/testing/selftests/kho/loongarch.conf
new file mode 100644
index 000000000000..b0551e0c2d77
--- /dev/null
+++ b/tools/testing/selftests/kho/loongarch.conf
@@ -0,0 +1,7 @@
+QEMU_CMD="qemu-system-loongarch64 -M virt -cpu la464"
+QEMU_KCONFIG="
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+"
+KERNEL_IMAGE="vmlinux.efi"
+KERNEL_CMDLINE="console=ttyS0 earlycon"
diff --git a/tools/testing/selftests/kho/vmtest.sh b/tools/testing/selftests/kho/vmtest.sh
index 49fdac8e8b15..a6ae9ac09595 100755
--- a/tools/testing/selftests/kho/vmtest.sh
+++ b/tools/testing/selftests/kho/vmtest.sh
@@ -21,7 +21,7 @@ Options:
 	-d)	path to the kernel build directory
 	-j)	number of jobs for compilation, similar to -j in make
 	-t)	run test for target_arch, requires CROSS_COMPILE set
-		supported targets: aarch64, x86_64
+		supported targets: aarch64, x86_64, loongarch64
 	-h)	display this help
 EOF
 }
@@ -123,6 +123,7 @@ function target_to_arch() {
 	case $target in
 	     aarch64) echo "arm64" ;;
 	     x86_64) echo "x86" ;;
+	     loongarch64) echo "loongarch" ;;
 	     *) skip "architecture $target is not supported"
 	esac
 }
-- 
2.25.1


  parent reply	other threads:[~2026-05-25  6:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  6:28 [PATCH 0/7] LoongArch: add KHO support and selftests George Guo
2026-05-25  6:28 ` [PATCH 1/7] LoongArch: Add KHO basic support George Guo
2026-05-25 17:34   ` Pratyush Yadav
2026-05-28 13:26     ` George Guo
2026-05-25  6:28 ` [PATCH 2/7] LoongArch: kho: strip stale kho_handover= from reused cmdline George Guo
2026-05-25 17:49   ` Pratyush Yadav
2026-05-25  6:28 ` [PATCH 3/7] LoongArch: Add missing linux/mm.h include in asm/io.h George Guo
2026-05-25  6:28 ` [PATCH 4/7] LoongArch: kexec: avoid overwriting QEMU's machine FDT at 0x100000 George Guo
2026-05-25  6:28 ` George Guo [this message]
2026-05-25  6:28 ` [PATCH 6/7] selftests/kho: LoongArch: disable PS/2 input devices for QEMU virt George Guo
2026-05-25  6:28 ` [PATCH 7/7] selftests/kho: handle QEMU not exiting after kexec on LoongArch George Guo
2026-05-25  7:48   ` Mike Rapoport
2026-05-25  7:48 ` [PATCH 0/7] LoongArch: add KHO support and selftests Mike Rapoport
2026-05-25 10:25   ` Huacai Chen
2026-05-25 11:24     ` Mike Rapoport

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=20260525062810.103367-6-dongtai.guo@linux.dev \
    --to=dongtai.guo@linux.dev \
    --cc=chenhuacai@kernel.org \
    --cc=graf@amazon.com \
    --cc=guodongtai@kylinos.cn \
    --cc=kernel@xen0n.name \
    --cc=kexec@lists.infradead.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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox