Skip to content

Commit 85a2720

Browse files
Chunyan Zhangsandiecao-dc
authored andcommitted
hmp: selftests: add on-target test script for K3 HMP
Add hmp-test.sh under tools/testing/selftests/spacemit/, a shell-only test script that validates the Spacemit HMP support on real K3 hardware (x100 = cpu0-7, a100 = cpu8-15). It is written for BusyBox ash and needs no tooling beyond taskset, awk and dmesg. Test cases: hotplug (DISRUPTIVE) cpu offline restrictions: the last regular cpu is refused, the last AI cpu is refused while an AI task is alive, and the last AI cpu does go offline once no AI task remains. The full cpu layout is restored afterwards. all env + baseline + bind + restrict. The directory is wired into the selftests build so that the script is installed by 'make kselftest-install' and run by run_kselftest.sh; it adds a TARGETS entry and a four-line Makefile using TEST_PROGS. The script exits 4 when /proc/set_ai_thread is absent, so a kernel without CONFIG_SPACEMIT_HMP is reported as a skip rather than a failure. No build step is involved: the script is copied directly to the board and run there, so a target rootfs with a shell is all it needs. Expected results on K3: "all" reports 21 passed, "hotplug" reports 7 passed, with no failures and no skips. Signed-off-by: Chunyan Zhang <chunyan.zhang@linux.spacemit.com>
1 parent 06e7f26 commit 85a2720

3 files changed

Lines changed: 537 additions & 0 deletions

File tree

‎tools/testing/selftests/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ TARGETS += seccomp
125125
TARGETS += sgx
126126
TARGETS += signal
127127
TARGETS += size
128+
TARGETS += spacemit
128129
TARGETS += sparc64
129130
TARGETS += splice
130131
TARGETS += static_keys
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
all:
3+
4+
TEST_PROGS := hmp-test.sh
5+
6+
include ../lib.mk
7+
8+
clean:

0 commit comments

Comments
 (0)