Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests/nolibc: add armthumb configuration
@ 2025-03-01 11:23 Thomas Weißschuh
  2025-03-01 11:23 ` [PATCH 1/2] selftests/nolibc: explicitly enable ARM mode Thomas Weißschuh
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2025-03-01 11:23 UTC (permalink / raw)
  To: Willy Tarreau, Shuah Khan
  Cc: linux-kselftest, linux-kernel, Thomas Weißschuh

While nolibc does support ARM Thumb instructions,
that support was not tested specifically.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (2):
      selftests/nolibc: explicitly enable ARM mode
      selftests/nolibc: add armthumb configuration

 tools/testing/selftests/nolibc/Makefile     | 7 +++++++
 tools/testing/selftests/nolibc/run-tests.sh | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)
---
base-commit: 3bd53b2fa57d9472d3af63b3f4d26023ba07b579
change-id: 20250228-nolibc-armthumb-372963140267

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


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

* [PATCH 1/2] selftests/nolibc: explicitly enable ARM mode
  2025-03-01 11:23 [PATCH 0/2] selftests/nolibc: add armthumb configuration Thomas Weißschuh
@ 2025-03-01 11:23 ` Thomas Weißschuh
  2025-03-01 11:24 ` [PATCH 2/2] selftests/nolibc: add armthumb configuration Thomas Weißschuh
  2025-03-01 16:32 ` [PATCH 0/2] " Willy Tarreau
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2025-03-01 11:23 UTC (permalink / raw)
  To: Willy Tarreau, Shuah Khan
  Cc: linux-kselftest, linux-kernel, Thomas Weißschuh

The default could also be -mthumb.

Explicitly use -marm to keep everything predictable.

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

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 14fc8c7e7c3067efddf0f729890fb78df731efb3..1dd2841a5fe781254a7f4b7b1ade677bd4bc0691 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -160,6 +160,7 @@ Q=@
 endif
 
 CFLAGS_i386 = $(call cc-option,-m32)
+CFLAGS_arm = -marm
 CFLAGS_ppc = -m32 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
 CFLAGS_ppc64 = -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
 CFLAGS_ppc64le = -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=elfv2)

-- 
2.48.1


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

* [PATCH 2/2] selftests/nolibc: add armthumb configuration
  2025-03-01 11:23 [PATCH 0/2] selftests/nolibc: add armthumb configuration Thomas Weißschuh
  2025-03-01 11:23 ` [PATCH 1/2] selftests/nolibc: explicitly enable ARM mode Thomas Weißschuh
@ 2025-03-01 11:24 ` Thomas Weißschuh
  2025-03-01 16:32 ` [PATCH 0/2] " Willy Tarreau
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2025-03-01 11:24 UTC (permalink / raw)
  To: Willy Tarreau, Shuah Khan
  Cc: linux-kselftest, linux-kernel, Thomas Weißschuh

While nolibc does support ARM Thumb instructions,
that support was not tested specifically.

Add a new test configuration for it.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 tools/testing/selftests/nolibc/Makefile     | 6 ++++++
 tools/testing/selftests/nolibc/run-tests.sh | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 1dd2841a5fe781254a7f4b7b1ade677bd4bc0691..58bcbbd029bc3ad9ccac968191b703ccf5df0717 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -47,6 +47,7 @@ XARCH_riscv      = riscv64
 XARCH            = $(or $(XARCH_$(ARCH)),$(ARCH))
 
 # map from user input variants to their kernel supported architectures
+ARCH_armthumb    = arm
 ARCH_ppc         = powerpc
 ARCH_ppc64       = powerpc
 ARCH_ppc64le     = powerpc
@@ -63,6 +64,7 @@ IMAGE_x86_64     = arch/x86/boot/bzImage
 IMAGE_x86        = arch/x86/boot/bzImage
 IMAGE_arm64      = arch/arm64/boot/Image
 IMAGE_arm        = arch/arm/boot/zImage
+IMAGE_armthumb   = arch/arm/boot/zImage
 IMAGE_mips32le   = vmlinuz
 IMAGE_mips32be   = vmlinuz
 IMAGE_ppc        = vmlinux
@@ -83,6 +85,7 @@ DEFCONFIG_x86_64     = defconfig
 DEFCONFIG_x86        = defconfig
 DEFCONFIG_arm64      = defconfig
 DEFCONFIG_arm        = multi_v7_defconfig
+DEFCONFIG_armthumb   = multi_v7_defconfig
 DEFCONFIG_mips32le   = malta_defconfig
 DEFCONFIG_mips32be   = malta_defconfig generic/eb.config
 DEFCONFIG_ppc        = pmac32_defconfig
@@ -107,6 +110,7 @@ QEMU_ARCH_x86_64     = x86_64
 QEMU_ARCH_x86        = x86_64
 QEMU_ARCH_arm64      = aarch64
 QEMU_ARCH_arm        = arm
+QEMU_ARCH_armthumb   = arm
 QEMU_ARCH_mips32le   = mipsel  # works with malta_defconfig
 QEMU_ARCH_mips32be  = mips
 QEMU_ARCH_ppc        = ppc
@@ -136,6 +140,7 @@ QEMU_ARGS_x86_64     = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $(
 QEMU_ARGS_x86        = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_arm64      = -M virt -cpu cortex-a53 -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_arm        = -M virt -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
+QEMU_ARGS_armthumb   = -M virt -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_mips32le   = -M malta -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_mips32be   = -M malta -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_ppc        = -M g3beige -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
@@ -161,6 +166,7 @@ endif
 
 CFLAGS_i386 = $(call cc-option,-m32)
 CFLAGS_arm = -marm
+CFLAGS_armthumb = -mthumb -march=armv6t2
 CFLAGS_ppc = -m32 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
 CFLAGS_ppc64 = -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple)
 CFLAGS_ppc64le = -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=elfv2)
diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/selftests/nolibc/run-tests.sh
index d716124f5e82b74deb48c9c2c3c699e4c076418c..0299a0912d4049dd12217f9835b81d231e1d2bfd 100755
--- a/tools/testing/selftests/nolibc/run-tests.sh
+++ b/tools/testing/selftests/nolibc/run-tests.sh
@@ -19,7 +19,7 @@ werror=1
 llvm=
 all_archs=(
 	i386 x86_64
-	arm64 arm
+	arm64 arm armthumb
 	mips32le mips32be
 	ppc ppc64 ppc64le
 	riscv32 riscv64
@@ -103,6 +103,7 @@ fi
 crosstool_arch() {
 	case "$1" in
 	arm64) echo aarch64;;
+	armthumb) echo arm;;
 	ppc) echo powerpc;;
 	ppc64) echo powerpc64;;
 	ppc64le) echo powerpc64;;
@@ -116,7 +117,7 @@ crosstool_arch() {
 
 crosstool_abi() {
 	case "$1" in
-	arm) echo linux-gnueabi;;
+	arm | armthumb) echo linux-gnueabi;;
 	*) echo linux;;
 	esac
 }

-- 
2.48.1


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

* Re: [PATCH 0/2] selftests/nolibc: add armthumb configuration
  2025-03-01 11:23 [PATCH 0/2] selftests/nolibc: add armthumb configuration Thomas Weißschuh
  2025-03-01 11:23 ` [PATCH 1/2] selftests/nolibc: explicitly enable ARM mode Thomas Weißschuh
  2025-03-01 11:24 ` [PATCH 2/2] selftests/nolibc: add armthumb configuration Thomas Weißschuh
@ 2025-03-01 16:32 ` Willy Tarreau
  2 siblings, 0 replies; 4+ messages in thread
From: Willy Tarreau @ 2025-03-01 16:32 UTC (permalink / raw)
  To: Thomas Weißschuh; +Cc: Shuah Khan, linux-kselftest, linux-kernel

On Sat, Mar 01, 2025 at 12:23:58PM +0100, Thomas Weißschuh wrote:
> While nolibc does support ARM Thumb instructions,
> that support was not tested specifically.

Good idea! In my case (and most likely most users), it actually allows
to test the Arm mode, because I think that the majority of Arm cross
compilers are configured to produce thumb2 code by default since it's
generally faster and quite smaller.

Tested-by: Willy Tarreau <w@1wt.eu>

Willy

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

end of thread, other threads:[~2025-03-01 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-01 11:23 [PATCH 0/2] selftests/nolibc: add armthumb configuration Thomas Weißschuh
2025-03-01 11:23 ` [PATCH 1/2] selftests/nolibc: explicitly enable ARM mode Thomas Weißschuh
2025-03-01 11:24 ` [PATCH 2/2] selftests/nolibc: add armthumb configuration Thomas Weißschuh
2025-03-01 16:32 ` [PATCH 0/2] " Willy Tarreau

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