public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/nolibc: fix sparc32 tests with -mcpu=v9
@ 2026-01-04 22:14 Thomas Weißschuh
  2026-01-05  7:44 ` Willy Tarreau
  2026-01-06 11:40 ` Geert Uytterhoeven
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Weißschuh @ 2026-01-04 22:14 UTC (permalink / raw)
  To: Willy Tarreau, Shuah Khan
  Cc: linux-kselftest, linux-kernel, Thomas Weißschuh

Since LLVM commit 39e30508a7f6 ("[Driver][Sparc] Default to -mcpu=v9 for
32-bit Linux/sparc64 (#109278)"), clang defaults to -mcpu=v9 for 32-bit
SPARC builds. -mcpu=v9 generates instructions which are not recognized
by qemu-sparc and qemu-system-sparc. Instead qemu-sparc32plus and
qemu-system-sparc64 with a 64-bit kernel and CONFIG_COMPAT are needed.

Rework the test setup so that -mcpu=v9 also works correctly.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 tools/testing/selftests/nolibc/Makefile.nolibc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/nolibc/Makefile.nolibc b/tools/testing/selftests/nolibc/Makefile.nolibc
index f9d43cbdc894..18f550c68932 100644
--- a/tools/testing/selftests/nolibc/Makefile.nolibc
+++ b/tools/testing/selftests/nolibc/Makefile.nolibc
@@ -117,7 +117,7 @@ DEFCONFIG_riscv32    = rv32_defconfig
 DEFCONFIG_riscv64    = defconfig
 DEFCONFIG_s390x      = defconfig
 DEFCONFIG_loongarch  = defconfig
-DEFCONFIG_sparc32    = sparc32_defconfig
+DEFCONFIG_sparc32    = sparc64_defconfig
 DEFCONFIG_sparc64    = sparc64_defconfig
 DEFCONFIG_m68k       = virt_defconfig
 DEFCONFIG_sh4        = rts7751r2dplus_defconfig
@@ -155,7 +155,7 @@ QEMU_ARCH_riscv32    = riscv32
 QEMU_ARCH_riscv64    = riscv64
 QEMU_ARCH_s390x      = s390x
 QEMU_ARCH_loongarch  = loongarch64
-QEMU_ARCH_sparc32    = sparc
+QEMU_ARCH_sparc32    = sparc64
 QEMU_ARCH_sparc64    = sparc64
 QEMU_ARCH_m68k       = m68k
 QEMU_ARCH_sh4        = sh4
@@ -164,6 +164,7 @@ QEMU_ARCH            = $(QEMU_ARCH_$(XARCH))
 QEMU_ARCH_USER_ppc64le = ppc64le
 QEMU_ARCH_USER_mipsn32le = mipsn32el
 QEMU_ARCH_USER_mipsn32be = mipsn32
+QEMU_ARCH_USER_sparc32 = sparc32plus
 QEMU_ARCH_USER         = $(or $(QEMU_ARCH_USER_$(XARCH)),$(QEMU_ARCH_$(XARCH)))
 
 QEMU_BIOS_DIR = /usr/share/edk2/
@@ -195,7 +196,7 @@ QEMU_ARGS_riscv32    = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_T
 QEMU_ARGS_riscv64    = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_s390x      = -M s390-ccw-virtio -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_loongarch  = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
-QEMU_ARGS_sparc32    = -M SS-5 -m 256M -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
+QEMU_ARGS_sparc32    = -M sun4u -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_sparc64    = -M sun4u -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_m68k       = -M virt -append "console=ttyGF0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_sh4        = -M r2d -serial file:/dev/stdout -append "console=ttySC1,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)"

---
base-commit: 9d16b22b17ddfd27df1da6088a962a72658f46d1
change-id: 20260104-nolibc-sparc32-fix-42b892ab1c0f

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-06 19:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-04 22:14 [PATCH] selftests/nolibc: fix sparc32 tests with -mcpu=v9 Thomas Weißschuh
2026-01-05  7:44 ` Willy Tarreau
2026-01-05  8:19   ` Thomas Weißschuh
2026-01-05  8:31     ` Willy Tarreau
2026-01-06 11:40 ` Geert Uytterhoeven
2026-01-06 11:47   ` Thomas Weißschuh
2026-01-06 13:36     ` Geert Uytterhoeven
2026-01-06 18:32       ` Thomas Weißschuh
2026-01-06 19:34         ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox