From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.99 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792754188; b=mhuYEA9fRhlkmgnDaN1durh3FZEE7tE3yrvE2y4AP9UfS5o2a3VFWFcAWAjeINfXEtGY 8AbjtMv4jkzLx2Mwo6dgIEnfKlxKzMFKlbVYZPRpjsOvSurI6/aBccfrceQuUMo9AKeEv muh2b6udvGRuodlAbLM4D2bOuyNOHxh66ka/5VSd62mDuRdcBpweD1z2KevHDhU2s7Dwq 3ZrNUwDGAznYJaZNfsSP4lHckObBokgMo1jJ9XTR+yjC4/GzC4jkNYQgblfKZPeEYBHDN DmjQdXXIUNxzDM8J1oQMCrzTIJDFDblhuKuB+kOmlQVCfCNL8QHHXMW4ZKz4RfJwBEw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792754188; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=UpRjfzyNCxF6lUBPMaKXf5c8n1ufZ+711CHxEJrOmlU=; b=bvZxoUFTtchLo+9y/cOLsy3utRGIfBgeZV0TtgouFRemmeBMBbmTeYZh8wfvfv6TBUDG cXAJbxJ+SSeWmSL1oAUSYZGq1jBhQGxbYFZ+rH/idBF+28Z+RhO/Tb9Kj6v65v1WS/ZhY jiWAZDXK1/xeEpsCWhMQfLaDvfTwhl4NkD7zXxNCpJp+smNBrU+cJ78DTnrmB6LFxTwDp nVw6CHiD+G3/H66lCUZ7MF9J8S9Kk5egA8txLaEBysdo3U1HdW3vGZJhdBbnkak7j2M9K lDQoqm0cYSUm9mIa45lpTXbgSSDxD/bdtrr0iklpsXTF/zN5huGipJjOYG3fRTqqO1Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=pNdXmUku; arc=none smtp.remote-ip=115.124.30.99 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3706606A31A; Fri, 23 Oct 2026 11:16:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A3706606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=pNdXmUku DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1792754183; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=UpRjfzyNCxF6lUBPMaKXf5c8n1ufZ+711CHxEJrOmlU=; b=pNdXmUku4BNrzbIqIkZrVcP7wejSw/sh+uaUfmUj4KbLzaeowOkcfUF5gFBbKxXEUOAI6p2owd+zrWMbfwVBMDTgOoIdIFQ2JbyMUKF155D0EN/0wj8OuJtMiBCvMpfP1h29qmep3hOjkp9NKnVDQx7T8WbHmkbtFoue4f7f7XA= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam011083073210;MF=cp0613@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0XDM1n5s_1792754182; Received: from DESKTOP-S9E58SO.localdomain(mailfrom:cp0613@linux.alibaba.com fp:SMTPD_---0XDM1n5s_1792754182 cluster:ay36) by smtp.aliyun-inc.com; Fri, 23 Oct 2026 19:16:23 +0800 From: Chen Pei To: pjw@kernel.org, palmer@dabbelt.com, alex@ghiti.fr, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org, graf@amazon.com, shuah@kernel.org Cc: guoren@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, kexec@lists.infradead.org Subject: [PATCH 3/4] selftests: kho: Add riscv support Date: Fri, 23 Oct 2026 19:16:11 +0800 Message-ID: <20261023111612.2134-4-cp0613@linux.alibaba.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261023111612.2134-1-cp0613@linux.alibaba.com> References: <20261023111612.2134-1-cp0613@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Teach the KHO vmtest runner about riscv64: map the target to ARCH riscv and describe the QEMU virt machine, the kernel image and its console -- a 16550A port probed from the device tree on virt, hence the SERIAL_8250{,_CONSOLE} and SERIAL_OF_PLATFORM symbols. Also select CONFIG_SPARSEMEM_MANUAL: the runner requires CONFIG_DEFERRED_STRUCT_PAGE_INIT, which depends on SPARSEMEM, while riscv falls back to FLATMEM (no ARCH_SPARSEMEM_DEFAULT), so without it the test would just be skipped. Signed-off-by: Chen Pei --- Test: qemu-system-riscv64 (virt, -cpu max, TCG), in-tree runner "tools/testing/selftests/kho/vmtest.sh -t riscv64" (boots the Image and kexec'es into the same Image). KHO: found kexec handover data. KHO: exec from: 7.3.0-rc7-00108-gc6e90ee4ccbb (count 1) test_kho: KHO restore succeeded ok 1 KHO succeeded # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 tools/testing/selftests/kho/riscv.conf | 9 +++++++++ tools/testing/selftests/kho/vmtest.sh | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/kho/riscv.conf diff --git a/tools/testing/selftests/kho/riscv.conf b/tools/testing/selftests/kho/riscv.conf new file mode 100644 index 000000000000..ec2a46cd45d5 --- /dev/null +++ b/tools/testing/selftests/kho/riscv.conf @@ -0,0 +1,9 @@ +QEMU_CMD="qemu-system-riscv64 -M virt -cpu max" +QEMU_KCONFIG=" +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SPARSEMEM_MANUAL=y +" +KERNEL_IMAGE="Image" +KERNEL_CMDLINE="console=ttyS0" diff --git a/tools/testing/selftests/kho/vmtest.sh b/tools/testing/selftests/kho/vmtest.sh index 0014bd76e88d..325af59f653a 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, riscv64 -h) display this help EOF } @@ -127,6 +127,7 @@ function target_to_arch() { case $target in aarch64) echo "arm64" ;; x86_64) echo "x86" ;; + riscv64) echo "riscv" ;; *) skip "architecture $target is not supported" esac } -- 2.50.1