From patchwork Wed Sep 15 00:13:52 2077 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: 163123 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp1077832vqo; Wed, 8 Nov 2023 09:40:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfJS0JZRez98Tb8wl7ZsKWUX4OQ+NTffvAZ/q+v5vyStJmLe0X8p7o3ZCe0qPyocIP9Q1Y X-Received: by 2002:a05:6a00:8c9:b0:68e:42c9:74e0 with SMTP id s9-20020a056a0008c900b0068e42c974e0mr2735490pfu.3.1699465258718; Wed, 08 Nov 2023 09:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699465258; cv=none; d=google.com; s=arc-20160816; b=uvKqjM7UmZbOsCo6Vlv2fjrvlTK6oanDqMS+MsjoNsHHNcf9nXgpKHQj09pTUJthFb JCAei+B4m7bYeDhPenvt8NuPCTbN2bDTTOXM+eIPLwRWwbq0n0nfIdwqxgyjpsGBJPEx 9ehGi/JSztChaggC65GQdNbeBrSOFKiIrMpyX3mIIfde2JCJ6MzTBEyFPV1fMuYyn0I1 ocQcMyviMum2fJiyJr0l9eWOmoHLl4FgdrCvFyQB5v5zkPprzBwSz5AVzSgNVvQ2adZL a+P2HmqIUyfZ2ZF9yJK32gtVZj03ZGuGbuv5/llTds419ItWcKdlsrboX47L3pqVmeLY 0cJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=6yk1g8Dnw5vkGUfA59RmLWSSfrCqWasTT9sQoXHMvy4=; fh=lrawtlvYUyTnD3YboMckJjmalpw48Rm60lz21Jj4CJE=; b=YPl87FTaZSwl18JymMPZbd2PTr4BtlwLO4ADQwFS5+hw+rLIU3la6Z1e6LQ1Hy9pqv /U2KYNz7LQp0kw5ovhCSa0SJFWDZMjybnr3FJuaWcOI1LQ15hPa9nOU5EPJayDfITYvr Q0IS6nWjV2nZQuDlmHGAVrSKB5WjbucK0l8mAWWY6tgls41XrrFpAFR/AhUoqSJP9VpX fWhCd9nAqm4JMspnDROc0VCXXhgsFm1zHXkP0Yy8Q3x/ME2dYyojxuIBSPOXeqdBI6DT kyGdaE+6TR/s6nL69H5qDJ6WoFyTQU7r3LWpWqN4rn242U0ElOFpjHCg2wb08gTPnyze ac5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=uYdGP+eX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b6-20020a63d806000000b005b90990ab02si4733549pgh.419.2023.11.08.09.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 09:40:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=uYdGP+eX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 85B3B811EDB3; Wed, 8 Nov 2023 09:40:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232312AbjKHRkM (ORCPT + 32 others); 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 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 08 Nov 2023 09:40:35 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DATE_IN_FUTURE_Q_PLUS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782018483234683221 X-GMAIL-MSGID: 1782018483234683221 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ßschuh --- tools/testing/selftests/nolibc/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/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 = s390x QEMU_ARCH_loongarch = loongarch64 QEMU_ARCH = $(QEMU_ARCH_$(XARCH)) +QEMU_ARCH_USER_ppc64le = ppc64le +QEMU_ARCH_USER = $(or $(QEMU_ARCH_USER_$(XARCH)),$(QEMU_ARCH_$(XARCH))) + QEMU_BIOS_DIR = /usr/share/edk2/ QEMU_BIOS_loongarch = $(QEMU_BIOS_DIR)/loongarch64/OVMF_CODE.fd @@ -223,7 +226,7 @@ run-nolibc-test: nolibc-test # 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 initramfs.cpio: kernel nolibc-test From patchwork Wed Sep 15 00:13:53 2077 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: 163124 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp1077836vqo; Wed, 8 Nov 2023 09:40:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IED6dHzYXKpSgzCIXRkJv8Vg3FXxJT+8qNiqDL6ntLVmtCfVVeoFIHtuUpD6CHkp5aKTmCN X-Received: by 2002:a05:6a00:2316:b0:6bb:aaf:d7db with SMTP id h22-20020a056a00231600b006bb0aafd7dbmr2822156pfh.29.1699465259280; Wed, 08 Nov 2023 09:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699465259; cv=none; d=google.com; s=arc-20160816; b=Rt7afUc/gsB5RZMJT5mZVmreDY7e/SJrnF855jXKNp3F0Cha2wk9rUCZgqqvPq3xSR f2W1PNilfDTlfZf1IhR5REaGDyZ/4mpqlWNtsf362PiVluAfnUV7Sk4bkMPwqpcI8jCB C/LXKDbATK0FE5tTj8uHDzHQXuQvNB0JcXZGdVqfcYxt66VjItHdTRpRnSz6Oh9l0fTE dwEidQhrMzumoIcjrdx0TsHtnzJairbTDLZO4kZK66u8L5v0/4+WOH2KbIaY+6Nf5Ds2 XhrLI88IbwXE08Y4zSre8rXuPbItiC/cFDRu1U1WyWBaOvAg5Ddj0yPjdzl/54NsGYpJ caCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=E614rdiiXRYoxuFsAr3vT2d9llLNpgPw4Z6mtA3spdg=; fh=lrawtlvYUyTnD3YboMckJjmalpw48Rm60lz21Jj4CJE=; b=vILNbEAky/HvKfsNKeCU+GZLOwgycCCIwepu3KtUT3z8wXmxdM/de3ysAq86TmMowH uZ36nKubuRpAMiL5BVg+0ZUmLqUbc78Fo/dGrDoWakGEtq+ToBm2IcFRu1L3lo7ByHv/ QauuPTvgFw4XirWIh8B+sDO5PhszsiByG59j7RytUgDdqTgK/WNQmEy22t6lP8pnzVVJ 1b09U5DcvP+E2J4dE1VkNG4zuABTQq8BS0GHg9PmZS1LRC4NSjIjs4ZHz8M6zLbFm3AY ipFeH8prs5smWzzc0PAV4e1gm8Gao/U5+fx9S5MIWs8ILSbFl+HmpY1EWcaNPmH1ikU3 wChA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=cY2V3bWd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j9-20020a056a00234900b0068fe0f46f27si13938708pfj.171.2023.11.08.09.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 09:40:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=cY2V3bWd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7F8BB807EB27; Wed, 8 Nov 2023 09:40:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232025AbjKHRkJ (ORCPT + 32 others); Wed, 8 Nov 2023 12:40:09 -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 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 08 Nov 2023 09:40:26 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DATE_IN_FUTURE_Q_PLUS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782018483662812410 X-GMAIL-MSGID: 1782018483662812410 qemu-user is faster than a full system test. Signed-off-by: Thomas Weißschuh --- 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/selftests/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="${XDG_CACHE_HOME:-"$HOME"/.cache}" download_location="${cache_dir}/crosstools/" build_location="$(realpath "${cache_dir}"/nolibc-tests/)" perform_download=0 +test_mode=system 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" -- "$@") +TEMP=$(getopt -o 'j:d:c:b:a:m:ph' -n "$0" -- "$@") 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: ${hostarch}) -b [DIR] Build location (default: ${build_location}) + -m [MODE] Test mode user/system (default: ${test_mode}) EOF } @@ -61,6 +63,9 @@ while true; do '-b') build_location="$(realpath "$2")" shift 2; continue ;; + '-m') + test_mode="$2" + shift 2; continue ;; '-h') print_usage exit 0 @@ -133,11 +138,22 @@ test_arch() { MAKE=(make -j"${nproc}" XARCH="${arch}" CROSS_COMPILE="${cross_compile}" O="${build_dir}") mkdir -p "$build_dir" - if [ ! -f "${build_dir}/.config" ]; then + if [ "$test_mode" = "system" ] && [ ! -f "${build_dir}/.config" ]; then swallow_output "${MAKE[@]}" defconfig fi + case "$test_mode" in + 'system') + test_target=run + ;; + 'user') + test_target=run-user + ;; + *) + echo "Unknown mode $test_mode" + exit 1 + esac printf '%-15s' "$arch:" - swallow_output "${MAKE[@]}" run V=1 + swallow_output "${MAKE[@]}" "$test_target" V=1 cp run.out run.out."${arch}" "${MAKE[@]}" report | grep passed }