From patchwork Sun Nov 5 11:34:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13445701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D99CC0018A for ; Sun, 5 Nov 2023 11:35:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229527AbjKELfL (ORCPT ); Sun, 5 Nov 2023 06:35:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbjKELfJ (ORCPT ); Sun, 5 Nov 2023 06:35:09 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CB05EB; Sun, 5 Nov 2023 03:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699184102; bh=bfoswv7ncWkCUqW4AE0EZoLtlErB+6knnnYOlA24mFg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ggObUooOsP16O4x6BewBPKt6dbJAKMDPCMukaNrJQ4tPmNjjhReY/M/3h2igCqr9e 8QDP9goT7oeZIGARnHqLn5ovBLbsZDsGMGdu0gdHzujocpCrT2c2D4SvmTm8BtFWmq HZob2QtRpfTDqOfB4RWC1qBbqcLoN1DTldflgf14= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 12:34:58 +0100 Subject: [PATCH v2 1/6] tools/nolibc: error out on unsupported architecture MIME-Version: 1.0 Message-Id: <20231105-nolibc-mips-be-v2-1-4ec993cb5407@weissschuh.net> References: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699184102; l=839; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=bfoswv7ncWkCUqW4AE0EZoLtlErB+6knnnYOlA24mFg=; b=h1P8i1kDOIISeYbFLfzWqMLh6zBFs5DBo7Ec2xs4xRvaX+LTXzcXL3OdniFMrew7OO+bp1Vbg 4liZd88i89SDABWH8QxgfHjGsWri5e7JtAdVORS/QKYZtWAg8u/Az5q X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When an architecture is unsupported arch.h would silently continue. This leads to a lot of followup errors because my_syscallX() is not defined and the startup code is missing. Avoid these confusing errors and fail the build early with a clear error message and location. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/include/nolibc/arch.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/include/nolibc/arch.h b/tools/include/nolibc/arch.h index e276fb0680af..2f72ccac0378 100644 --- a/tools/include/nolibc/arch.h +++ b/tools/include/nolibc/arch.h @@ -33,6 +33,8 @@ #include "arch-s390.h" #elif defined(__loongarch__) #include "arch-loongarch.h" +#else +#error Unsupported Architecture #endif #endif /* _NOLIBC_ARCH_H */ From patchwork Sun Nov 5 11:34:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13445700 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16FD5C4167B for ; Sun, 5 Nov 2023 11:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230251AbjKELfL (ORCPT ); Sun, 5 Nov 2023 06:35:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjKELfJ (ORCPT ); Sun, 5 Nov 2023 06:35:09 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CC6DFA; Sun, 5 Nov 2023 03:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699184102; bh=a+9ND8eF9nLxQ/1grgp4DdoijTDtNpAFxfKUQan+h7M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Ve2zD0Vq063PtHS4Lxh8WD9DDxhauFe4gHtNgrPbeBRPljXDqfv9QoEwCmNhDHS5G lK+C2gEE8yzKYMICNcftDE47lMiW6NgIo7LWWV3anX8+XsFPaz8Sp1XhSo9XZsdW1H ii5nZg6Avq/KlnIbXcQNrDtFPCCNW2vdI4iLK6GI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 12:34:59 +0100 Subject: [PATCH v2 2/6] tools/nolibc: move MIPS ABI validation into arch-mips.h MIME-Version: 1.0 Message-Id: <20231105-nolibc-mips-be-v2-2-4ec993cb5407@weissschuh.net> References: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699184102; l=1437; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=a+9ND8eF9nLxQ/1grgp4DdoijTDtNpAFxfKUQan+h7M=; b=eJbW210gN9ZiHm9562zmKqj43K5z7WF41/80UWLA634WixdMeLP8a2IsPlrCKGle0tYPZ1JqO GdIZVn6/JIlCIdaJL0d032Me/fqn7ESrBaPMTAywCsnqJU/ue/4XLzz X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When installing nolibc to a sysroot arch.h is not used so its ABI check is bypassed. This makes is possible to compile nolibc with a non O32 ABI which may build but can not run. Move the check into arch-mips.h so it will always be evaluated. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/include/nolibc/arch-mips.h | 4 ++++ tools/include/nolibc/arch.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-mips.h index 4ab6fa54beee..3a2c76716b83 100644 --- a/tools/include/nolibc/arch-mips.h +++ b/tools/include/nolibc/arch-mips.h @@ -10,6 +10,10 @@ #include "compiler.h" #include "crt.h" +#if !defined(_ABIO32) +#error Unsupported MIPS ABI +#endif + /* Syscalls for MIPS ABI O32 : * - WARNING! there's always a delayed slot! * - WARNING again, the syntax is different, registers take a '$' and numbers diff --git a/tools/include/nolibc/arch.h b/tools/include/nolibc/arch.h index 2f72ccac0378..c8f4e5d3add9 100644 --- a/tools/include/nolibc/arch.h +++ b/tools/include/nolibc/arch.h @@ -23,7 +23,7 @@ #include "arch-arm.h" #elif defined(__aarch64__) #include "arch-aarch64.h" -#elif defined(__mips__) && defined(_ABIO32) +#elif defined(__mips__) #include "arch-mips.h" #elif defined(__powerpc__) #include "arch-powerpc.h" From patchwork Sun Nov 5 11:35:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13445702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 625AFC4332F for ; Sun, 5 Nov 2023 11:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230272AbjKELfL (ORCPT ); Sun, 5 Nov 2023 06:35:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230236AbjKELfK (ORCPT ); Sun, 5 Nov 2023 06:35:10 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF97E1; Sun, 5 Nov 2023 03:35:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699184102; bh=IdJFXFy2rUhosoH8Z7h6MB9DWZTcM5ZHRroV78U+Fiw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aQnhtEh4oHnnVRhhOMGSxfSYjJY8wGO/yqMvBBwPv7MsQ+hUu15HzjWjM6EzPMXW0 ghAOBZ/OpaLrcWc7aKgKMYdpV0uTb3lzcS/oqS2GWTNdZ9n2qKUIyRneCIpPFpjVrp GBmwNIxwKAt14r8Uz6lbBupZPeZo5RKYKzGEWbMg= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 12:35:00 +0100 Subject: [PATCH v2 3/6] selftests/nolibc: use XARCH for MIPS MIME-Version: 1.0 Message-Id: <20231105-nolibc-mips-be-v2-3-4ec993cb5407@weissschuh.net> References: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699184102; l=4274; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=IdJFXFy2rUhosoH8Z7h6MB9DWZTcM5ZHRroV78U+Fiw=; b=ilBW37jFgjSgNWl7vowrgRQbusU+xSSnJUlYm4CP5feL39NDJ8YsItziynNCdK0syWRtcrgi4 +8BzjAQeX7eDVyaAzOq7uwqnbvGyFDQcIKnZHAbY/NwPzRSW8Uk3Lte X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org MIPS has many different configurations prepare the support of additional ones by moving the build of MIPS to the generic XARCH infrastructure. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 12 +++++++----- tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index c5df1617cbc3..71fa5fdd10b6 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -40,12 +40,14 @@ objtree ?= $(srctree) # configure default variants for target kernel supported architectures XARCH_powerpc = ppc +XARCH_mips = mips32le XARCH = $(or $(XARCH_$(ARCH)),$(ARCH)) # map from user input variants to their kernel supported architectures ARCH_ppc = powerpc ARCH_ppc64 = powerpc ARCH_ppc64le = powerpc +ARCH_mips32le = mips ARCH := $(or $(ARCH_$(XARCH)),$(XARCH)) # kernel image names by architecture @@ -54,7 +56,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_mips = vmlinuz +IMAGE_mips32le = vmlinuz IMAGE_ppc = vmlinux IMAGE_ppc64 = vmlinux IMAGE_ppc64le = arch/powerpc/boot/zImage @@ -70,7 +72,7 @@ DEFCONFIG_x86_64 = defconfig DEFCONFIG_x86 = defconfig DEFCONFIG_arm64 = defconfig DEFCONFIG_arm = multi_v7_defconfig -DEFCONFIG_mips = malta_defconfig +DEFCONFIG_mips32le = malta_defconfig DEFCONFIG_ppc = pmac32_defconfig DEFCONFIG_ppc64 = powernv_be_defconfig DEFCONFIG_ppc64le = powernv_defconfig @@ -88,7 +90,7 @@ QEMU_ARCH_x86_64 = x86_64 QEMU_ARCH_x86 = x86_64 QEMU_ARCH_arm64 = aarch64 QEMU_ARCH_arm = arm -QEMU_ARCH_mips = mipsel # works with malta_defconfig +QEMU_ARCH_mips32le = mipsel # works with malta_defconfig QEMU_ARCH_ppc = ppc QEMU_ARCH_ppc64 = ppc64 QEMU_ARCH_ppc64le = ppc64 @@ -110,7 +112,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_mips = -M malta -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)" +QEMU_ARGS_mips32le = -M malta -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_ppc = -M g3beige -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_ppc64 = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_ppc64le = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" @@ -134,7 +136,7 @@ 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) CFLAGS_s390 = -m64 -CFLAGS_mips = -EL +CFLAGS_mips32le = -EL CFLAGS_STACKPROTECTOR ?= $(call cc-option,-mstack-protector-guard=global $(call cc-option,-fstack-protector-all)) CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra \ $(call cc-option,-fno-stack-protector) \ diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/selftests/nolibc/run-tests.sh index 1bf020d49f54..8f2c3bc572cb 100755 --- a/tools/testing/selftests/nolibc/run-tests.sh +++ b/tools/testing/selftests/nolibc/run-tests.sh @@ -14,7 +14,7 @@ cache_dir="${XDG_CACHE_HOME:-"$HOME"/.cache}" download_location="${cache_dir}/crosstools/" build_location="$(realpath "${cache_dir}"/nolibc-tests/)" perform_download=0 -archs="i386 x86_64 arm64 arm mips ppc ppc64 ppc64le riscv s390 loongarch" +archs="i386 x86_64 arm64 arm mips32le ppc ppc64 ppc64le riscv s390 loongarch" TEMP=$(getopt -o 'j:d:c:b:a:ph' -n "$0" -- "$@") From patchwork Sun Nov 5 11:35:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13445698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78A74C4332F for ; Sun, 5 Nov 2023 11:35:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230212AbjKELfK (ORCPT ); Sun, 5 Nov 2023 06:35:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjKELfJ (ORCPT ); Sun, 5 Nov 2023 06:35:09 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0785DE; Sun, 5 Nov 2023 03:35:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699184102; bh=1Fz6cfHmleRuZplVAtovhMSjgDBjjcDGQMidibUEkzU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=TIQDSiJsOnarAiJSnsHU0m5JNYUon3j+xe55ZpI3ASxwzTIdF0eaB5HwHvoxtZN5z NrciJwTZ9Q4iy5MsV+N0PWd4NOO5SytwWLUlsu2fM4LMiVbxXNSc0bi3EmcUNRLWAb ZHZcN8LXskLLUAAOy2ch6nDl7bdehQAz3gVQ45DU= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 12:35:01 +0100 Subject: [PATCH v2 4/6] selftests/nolibc: explicitly specify ABI for MIPS MIME-Version: 1.0 Message-Id: <20231105-nolibc-mips-be-v2-4-4ec993cb5407@weissschuh.net> References: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699184102; l=1085; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=1Fz6cfHmleRuZplVAtovhMSjgDBjjcDGQMidibUEkzU=; b=Hk54/oIuM0hpLZtNUSMLxOrddWKinH9QQOjKhEmDZbcOfHO90O9MYdjAXrwxRX2SJmnhU9pZB 9pyHB9q9OlEBM1MUDRc/Ty5Su5pt844ry1CojReLjuUXqfGxyMr6vK3 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org More ABIs exist, for better clarity specify it explicitly everywhere. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 71fa5fdd10b6..6a5e67f65daa 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -136,7 +136,7 @@ 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) CFLAGS_s390 = -m64 -CFLAGS_mips32le = -EL +CFLAGS_mips32le = -EL -mabi=32 CFLAGS_STACKPROTECTOR ?= $(call cc-option,-mstack-protector-guard=global $(call cc-option,-fstack-protector-all)) CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra \ $(call cc-option,-fno-stack-protector) \ From patchwork Sun Nov 5 11:35:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13445699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D44EC4167D for ; Sun, 5 Nov 2023 11:35:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbjKELfK (ORCPT ); Sun, 5 Nov 2023 06:35:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKELfJ (ORCPT ); Sun, 5 Nov 2023 06:35:09 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BEC2F2; Sun, 5 Nov 2023 03:35:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699184103; bh=nyrjPvpNj7WNK2ijhv221XrS7R5GMOB+fysjKb+NE6o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=msFqDpcXSSjuZeof1fOOu4F3KvdFjPlRQWnmsbkx5IncwISbVjpvwj1+4HSuM14NX mpPaEfVWolk/aS1Vg1HWeHSomdt/kCxJL9Oe/EC8g0GVQ+cSdnRImwt7jO4a+NJHT0 QsaOO4ZajOXcaaF3oKamxoRIjWA3iE2L8ukPUUPk= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 12:35:02 +0100 Subject: [PATCH v2 5/6] selftests/nolibc: extraconfig support MIME-Version: 1.0 Message-Id: <20231105-nolibc-mips-be-v2-5-4ec993cb5407@weissschuh.net> References: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699184102; l=1285; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=nyrjPvpNj7WNK2ijhv221XrS7R5GMOB+fysjKb+NE6o=; b=pMFDcAOHYf4oHIZkEkSHQT55uQDBq91NgSrk1f7kzN2JjkQ9CLhIP4kxLS0KgKkI32bVdqLIH 2KcXs4Yuyf3DEiRrfyVY62+QU7RUH9pQxmmtF8Ce1pAS4EZ0OTMGa1l X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Allow some postprocessing of defconfig files. Suggested-by: Zhangjin Wu Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 6a5e67f65daa..6a1f7f9edf91 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -81,6 +81,8 @@ DEFCONFIG_s390 = defconfig DEFCONFIG_loongarch = defconfig DEFCONFIG = $(DEFCONFIG_$(XARCH)) +EXTRACONFIG = $(EXTRACONFIG_$(XARCH)) + # optional tests to run (default = all) TEST = @@ -227,6 +229,10 @@ initramfs: nolibc-test defconfig: $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare + $(Q)if [ -n "$(EXTRACONFIG)" ]; then \ + $(srctree)/scripts/config --file $(objtree)/.config $(EXTRACONFIG); \ + $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) olddefconfig < /dev/null; \ + fi kernel: $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) From patchwork Sun Nov 5 11:35:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13445704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E452AC001B5 for ; Sun, 5 Nov 2023 11:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230305AbjKELfN (ORCPT ); Sun, 5 Nov 2023 06:35:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbjKELfL (ORCPT ); Sun, 5 Nov 2023 06:35:11 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 396FEF2; Sun, 5 Nov 2023 03:35:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699184103; bh=JMznj9mOW7CN1oWuJEQJDJv9JNNBt8ZPWdQQ6heUErg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=TQXfTOvi4UfwXiDRBcFkg5309vTVzgWrz0rUXBX6i4cPRvLckKZI0XB9eTr2f9D2l nXAPe+yHJCpCsuYsAgCMZtZ1+8SgfcSTX/nPhpGc3FotkMcPBEKYHq7EWBcNHV/6Z7 6/YmhWRrRVI+P39tlbTrthzvB5rt8REXNh6uxyl8= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 05 Nov 2023 12:35:03 +0100 Subject: [PATCH v2 6/6] selftests/nolibc: add configuration for mipso32be MIME-Version: 1.0 Message-Id: <20231105-nolibc-mips-be-v2-6-4ec993cb5407@weissschuh.net> References: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> In-Reply-To: <20231105-nolibc-mips-be-v2-0-4ec993cb5407@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699184102; l=3924; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=JMznj9mOW7CN1oWuJEQJDJv9JNNBt8ZPWdQQ6heUErg=; b=e2lPYtGp8wPa8drS+Pws16dnNRxF+v35zT7XNC20bGKTaCuDR3t3uX4E6S541i328LKhkkazb FogZug63MYaB4tBz+mNy4sxa0BcZ7K1qiuLPXDEMkaHDFwZKjzbhqqh X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Allow testing MIPS O32 big endian. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 7 +++++++ tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 6a1f7f9edf91..508435b8ac2a 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -48,6 +48,7 @@ ARCH_ppc = powerpc ARCH_ppc64 = powerpc ARCH_ppc64le = powerpc ARCH_mips32le = mips +ARCH_mips32be = mips ARCH := $(or $(ARCH_$(XARCH)),$(XARCH)) # kernel image names by architecture @@ -57,6 +58,7 @@ IMAGE_x86 = arch/x86/boot/bzImage IMAGE_arm64 = arch/arm64/boot/Image IMAGE_arm = arch/arm/boot/zImage IMAGE_mips32le = vmlinuz +IMAGE_mips32be = vmlinuz IMAGE_ppc = vmlinux IMAGE_ppc64 = vmlinux IMAGE_ppc64le = arch/powerpc/boot/zImage @@ -73,6 +75,7 @@ DEFCONFIG_x86 = defconfig DEFCONFIG_arm64 = defconfig DEFCONFIG_arm = multi_v7_defconfig DEFCONFIG_mips32le = malta_defconfig +DEFCONFIG_mips32be = malta_defconfig DEFCONFIG_ppc = pmac32_defconfig DEFCONFIG_ppc64 = powernv_be_defconfig DEFCONFIG_ppc64le = powernv_defconfig @@ -81,6 +84,7 @@ DEFCONFIG_s390 = defconfig DEFCONFIG_loongarch = defconfig DEFCONFIG = $(DEFCONFIG_$(XARCH)) +EXTRACONFIG_mips32be = -d CONFIG_CPU_LITTLE_ENDIAN -e CONFIG_CPU_BIG_ENDIAN EXTRACONFIG = $(EXTRACONFIG_$(XARCH)) # optional tests to run (default = all) @@ -93,6 +97,7 @@ QEMU_ARCH_x86 = x86_64 QEMU_ARCH_arm64 = aarch64 QEMU_ARCH_arm = arm QEMU_ARCH_mips32le = mipsel # works with malta_defconfig +QEMU_ARCH_mips32be = mips QEMU_ARCH_ppc = ppc QEMU_ARCH_ppc64 = ppc64 QEMU_ARCH_ppc64le = ppc64 @@ -115,6 +120,7 @@ QEMU_ARGS_x86 = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $( 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_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=%)" QEMU_ARGS_ppc64 = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_ppc64le = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" @@ -139,6 +145,7 @@ CFLAGS_ppc64 = -m64 -mbig-endian -mno-vsx $(call cc-option,-mmultiple) CFLAGS_ppc64le = -m64 -mlittle-endian -mno-vsx $(call cc-option,-mabi=elfv2) CFLAGS_s390 = -m64 CFLAGS_mips32le = -EL -mabi=32 +CFLAGS_mips32be = -EB -mabi=32 CFLAGS_STACKPROTECTOR ?= $(call cc-option,-mstack-protector-guard=global $(call cc-option,-fstack-protector-all)) CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra \ $(call cc-option,-fno-stack-protector) \ diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/selftests/nolibc/run-tests.sh index 8f2c3bc572cb..3a1eaccfbd8d 100755 --- a/tools/testing/selftests/nolibc/run-tests.sh +++ b/tools/testing/selftests/nolibc/run-tests.sh @@ -14,7 +14,7 @@ cache_dir="${XDG_CACHE_HOME:-"$HOME"/.cache}" download_location="${cache_dir}/crosstools/" build_location="$(realpath "${cache_dir}"/nolibc-tests/)" perform_download=0 -archs="i386 x86_64 arm64 arm mips32le ppc ppc64 ppc64le riscv s390 loongarch" +archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv s390 loongarch" TEMP=$(getopt -o 'j:d:c:b:a:ph' -n "$0" -- "$@")