From nobody Sun May 19 13:08:01 2024 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 DD61AC4332F for ; Wed, 8 Nov 2023 17:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232489AbjKHRkM (ORCPT ); Wed, 8 Nov 2023 12:40:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbjKHRkI (ORCPT ); Wed, 8 Nov 2023 12:40:08 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B50F199; Wed, 8 Nov 2023 09:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699465203; bh=tiJ2JW2vQSAVtrjfe1rVfr6WSRjf+WLHWHD+0FEQ1ao=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uYdGP+eXcfxfrE2KHIdruvOGEPrt1GzfgH5IpaVk6yTd4v4tdvKQ2ayjtQdrzUd4g g2hmIqhF0HkijSiFZLvOHYcCCRp5dYsVo+AfnmG5xSIwF5C2HhNjLd8lWfj9xlFdOL xllWEA6wgfKn9hH86avlVAvwZ4AQPeyzaEb1FwXI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 15 Sep 2077 02:13:52 +0200 Subject: [PATCH 1/2] selftests/nolibc: introduce QEMU_ARCH_USER MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20770915-nolibc-run-user-v1-1-3caec61726dc@weissschuh.net> References: <20770915-nolibc-run-user-v1-0-3caec61726dc@weissschuh.net> In-Reply-To: <20770915-nolibc-run-user-v1-0-3caec61726dc@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@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=3398890432; l=1348; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=tiJ2JW2vQSAVtrjfe1rVfr6WSRjf+WLHWHD+0FEQ1ao=; b=tFbY13AASe4iUbNe8F6FfUWoaOi3NOeLIFYlxn7lHFwI9In7TA6azw6dVXrTT7DhGesHOAOdT 3kSnoLAx+HiA3B+FmiAzOic7aCJnBUWrEh/5muayr0yh7R3OLR9g7VH X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While ppc64le shares the same executable with regular ppc64 the user variant needs has a dedicated executable. Introduce a new QEMU_ARCH_USER Makefile variable to accommodate that. Fixes: 17362f3d0bd3 ("selftests/nolibc: use qemu-system-ppc64 for ppc64le") Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/nolibc/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selfte= sts/nolibc/Makefile index 508435b8ac2a..501bd41e0830 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -106,6 +106,9 @@ QEMU_ARCH_s390 =3D s390x QEMU_ARCH_loongarch =3D loongarch64 QEMU_ARCH =3D $(QEMU_ARCH_$(XARCH)) =20 +QEMU_ARCH_USER_ppc64le =3D ppc64le +QEMU_ARCH_USER =3D $(or $(QEMU_ARCH_USER_$(XARCH)),$(QEMU_ARCH_$(X= ARCH))) + QEMU_BIOS_DIR =3D /usr/share/edk2/ QEMU_BIOS_loongarch =3D $(QEMU_BIOS_DIR)/loongarch64/OVMF_CODE.fd =20 @@ -223,7 +226,7 @@ run-nolibc-test: nolibc-test =20 # qemu user-land test run-user: nolibc-test - $(Q)qemu-$(QEMU_ARCH) ./nolibc-test > "$(CURDIR)/run.out" || : + $(Q)qemu-$(QEMU_ARCH_USER) ./nolibc-test > "$(CURDIR)/run.out" || : $(Q)$(REPORT) $(CURDIR)/run.out =20 initramfs.cpio: kernel nolibc-test --=20 2.42.1 From nobody Sun May 19 13:08:01 2024 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 1DD88C41535 for ; Wed, 8 Nov 2023 17:40:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232099AbjKHRkK (ORCPT ); Wed, 8 Nov 2023 12:40:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjKHRkI (ORCPT ); Wed, 8 Nov 2023 12:40:08 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B5871FF9; Wed, 8 Nov 2023 09:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1699465203; bh=hrSs+ELRz/jSt3WaBZG039mXUiADzaDK3quVSJkBbbQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cY2V3bWdliYdj4isK0+f2qLz2sskHnNXV6oW+rJo/j7Wrc0p93pKpIHDXn2mmE+1D NxnMJQqW/NvwHFdTekZyT/hGHS/6xJM69cwWEpyWgF5zd1a58slpb2oYqtza74dJXj mrChZM83iEsNaj+Lfopv0zipPnhrxZdw2MLJZDo8= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 15 Sep 2077 02:13:53 +0200 Subject: [PATCH 2/2] selftests/nolibc: run-tests.sh: enable testing via qemu-user MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20770915-nolibc-run-user-v1-2-3caec61726dc@weissschuh.net> References: <20770915-nolibc-run-user-v1-0-3caec61726dc@weissschuh.net> In-Reply-To: <20770915-nolibc-run-user-v1-0-3caec61726dc@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@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=3398890432; l=2167; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=hrSs+ELRz/jSt3WaBZG039mXUiADzaDK3quVSJkBbbQ=; b=BtJDyH6ArfAWz9IHWMmkI/ILA4rmjwjryl0P79bAlWzKH/YtjZgsGJSBKU6d39kfuyMw8e8pp 2KR+T4WN9x2DgIimnUn2yaePUh8kQ+xPYtAAvt6CcBKV5pkgYJPjTbv X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org qemu-user is faster than a full system test. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/nolibc/run-tests.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/se= lftests/nolibc/run-tests.sh index 3a1eaccfbd8d..c0a5a7cea9fa 100755 --- a/tools/testing/selftests/nolibc/run-tests.sh +++ b/tools/testing/selftests/nolibc/run-tests.sh @@ -14,9 +14,10 @@ cache_dir=3D"${XDG_CACHE_HOME:-"$HOME"/.cache}" download_location=3D"${cache_dir}/crosstools/" build_location=3D"$(realpath "${cache_dir}"/nolibc-tests/)" perform_download=3D0 +test_mode=3Dsystem archs=3D"i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv s= 390 loongarch" =20 -TEMP=3D$(getopt -o 'j:d:c:b:a:ph' -n "$0" -- "$@") +TEMP=3D$(getopt -o 'j:d:c:b:a:m:ph' -n "$0" -- "$@") =20 eval set -- "$TEMP" unset TEMP @@ -38,6 +39,7 @@ Options: -c [VERSION] Version of toolchains to use (default: ${crosstool_version= }) -a [ARCH] Host architecture of toolchains to use (default: ${hostarc= h}) -b [DIR] Build location (default: ${build_location}) + -m [MODE] Test mode user/system (default: ${test_mode}) EOF } =20 @@ -61,6 +63,9 @@ while true; do '-b') build_location=3D"$(realpath "$2")" shift 2; continue ;; + '-m') + test_mode=3D"$2" + shift 2; continue ;; '-h') print_usage exit 0 @@ -133,11 +138,22 @@ test_arch() { MAKE=3D(make -j"${nproc}" XARCH=3D"${arch}" CROSS_COMPILE=3D"${cross_comp= ile}" O=3D"${build_dir}") =20 mkdir -p "$build_dir" - if [ ! -f "${build_dir}/.config" ]; then + if [ "$test_mode" =3D "system" ] && [ ! -f "${build_dir}/.config" ]; then swallow_output "${MAKE[@]}" defconfig fi + case "$test_mode" in + 'system') + test_target=3Drun + ;; + 'user') + test_target=3Drun-user + ;; + *) + echo "Unknown mode $test_mode" + exit 1 + esac printf '%-15s' "$arch:" - swallow_output "${MAKE[@]}" run V=3D1 + swallow_output "${MAKE[@]}" "$test_target" V=3D1 cp run.out run.out."${arch}" "${MAKE[@]}" report | grep passed } --=20 2.42.1