From patchwork Thu Jul 27 20:22:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127172 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp7690vqg; Thu, 27 Jul 2023 13:55:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlHVS++pQIFohnOSLJwYIkYpQlpyuVltFmpx38gyMR1txWGDbavYEn6HGZrXtLm8dxn5IINS X-Received: by 2002:a05:6808:23c6:b0:3a3:95f9:c99b with SMTP id bq6-20020a05680823c600b003a395f9c99bmr443494oib.35.1690491354762; Thu, 27 Jul 2023 13:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690491354; cv=none; d=google.com; s=arc-20160816; b=peMhUZp0QZeoH8bzGA4M7qHVFJX/jTxwA3K9z5yVpBAa50bbXgAdrpsPr1qft0Sp4n 2o1uYG10pcwWNCYTvPYaUfezQ7Ennig7Z3CeTjYbKu7xRkzBrryVggV4D380OTpcdArM CbkM4cAntPrHHJ8fZsbzcbeY/n84VXC7Vv4kE3Qc1rMqJc8AnuhUBpAoSqPoW3f9G/4w Ek9ws7aT00Cp4wSNrhhDzong0PPWf9zeTEVItRlORjQnN1V1JyAFrY4idzsKZcPPpmd9 qSpLNwqdivkqH3QdhIQYXWebiIjhOcOr/q9p81/xD0nDklGDmL6hcwMs2rT7tNy67p3+ cOxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=dZdm0PPFfZekmhzhUeLMBU11g8LEl72e1OZ08e3s0XE=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=aLbQEYsy6x/ZA0GGPyY8LG9KLwu4jMw/JhbhufOulxdnXkpy8owCMXXUfq8ccPNSsm 0hfGblGQ9jjBr24zdYG164oGwdupHUwnMDe9mF5WMkUBs5iY25Cnch8iMonB0u8beZLz I/wzjv8X/WsZz9xwcTzZFpKJSH0YGcJa7tzQwUiryyrnDQD9yUuhPqfSWkc6/E4D6KFe hjKKcU0+y5uKldFQfbn6dkKbvwRW1LDmZJhqLgGJ0HKTIRyKobVPepacuLqJ2MqvN/y3 6kt27xluLKV4jZNu3oZC6f1uh73yYIpqnAapIbX+QPcAG0oLZzTdWZp2CIdRdYkdQqgB wzJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a17090a348100b00267ec897aa7si1838937pjb.104.2023.07.27.13.55.41; Thu, 27 Jul 2023 13:55:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232815AbjG0UXD (ORCPT + 99 others); Thu, 27 Jul 2023 16:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232824AbjG0UW6 (ORCPT ); Thu, 27 Jul 2023 16:22:58 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F236F2D67; Thu, 27 Jul 2023 13:22:53 -0700 (PDT) X-QQ-mid: bizesmtp88t1690489363tb8slm3z Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:22:42 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: q+EIYT+FhZqrDLdu2684eR5Czllj1f6+FLo1hVSobBXoXKvq/9go9/jOS6tRf PMdHGvcVLRKu36l8VlpvSphXqPDUm3AUSHxcqiESgvAcL7AJo+WmsIjTUO/LxAoBSM0eJU/ blFkSG7ZX8zYzDeZgvyOUJg0tFPY5bmbL2H8e9Lts7azb/kRUQHD7ehMUHtHtImPOD7thfl OhnAOBmITZ1+AEG1C7T0101m/QGw6Kknh6cL9Pql4xM5AQTaHrlGCNgwc2JNzdWxOWSHf/X YJzlOtdku2Qhpw0/ME39BXaXp8mT7DfTn4tgzoyamTd6f9g7PxTUCXGIA9PrQOZ8wUZMkn0 w0RWIrpNYFUtwKfwf1M27fgCeRVlzRFEgVPq66fNTfowH1QQ/nLUuArh7OLjg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 5556135556970039063 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 01/12] selftests/nolibc: allow report with existing test log Date: Fri, 28 Jul 2023 04:22:42 +0800 Message-Id: <50b239f40ddbf4bd3e067c39330f99bf63c71147.1690489039.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772608662720607821 X-GMAIL-MSGID: 1772608662720607821 After the tests finish, it is valuable to report and summarize with existing test log. This avoid rerun or run the tests again when not necessary. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 2e9694370913..75419b695f0d 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -207,6 +207,10 @@ rerun: $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" $(Q)$(REPORT) $(CURDIR)/run.out +# report with existing test log +report: + $(Q)$(REPORT_RUN_OUT) + clean: $(call QUIET_CLEAN, sysroot) $(Q)rm -rf sysroot From patchwork Thu Jul 27 20:23:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127163 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:d09a:b0:134:c3fc:3153 with SMTP id jc26csp189750rwb; Thu, 27 Jul 2023 13:48:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlEOkXWKaIJVBd+D0RfUqF3SqX1Ts5VrAHM8P7TT12tqUAPkHc23D7YcRAxVuCsEQkWSby8n X-Received: by 2002:a05:6a21:790b:b0:137:bc72:9c08 with SMTP id bg11-20020a056a21790b00b00137bc729c08mr198094pzc.16.1690490929564; Thu, 27 Jul 2023 13:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690490929; cv=none; d=google.com; s=arc-20160816; b=ITNmteMt629kBbMBNfTfuiFyQcFKCZbQ9g5NZ0Thfc0irP+XQlizfiLHDnoxporaTc FynGL1tw+RyM7/q/kjaARH7RjuhfFWuqQqer0NQdjmrRCPtECzf47VbqnEz6QE7d7Wd0 LsfX7ZAP9OPfY/9ndo0FtM8t/JXVUJ3No0RtppXkO6rVWAF8aHixIreWUloINe7h/+SA d+gNv7PnyaFvfuxtfDKswd9lRzxzScNBfmm5aaHPQknrd1G9ws7jle30+a5l4HD46nBV 9ii1IYJswPpPBdTZ7+w8iVpHZ90jPHslZmQ6qlYzpQIrRMOXQVKQ/1wwuAryG153M/zD blEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=BJ+QokMtvD+4tn4xAg26GzCUiuGpaEumH+Q0OlMAIQU=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=tde2LSWE+SYNm6Y08yob2tehGGBf4+u5USdeJ5O4pQcRcIyiTPXv1K7ylypJgO06A3 4oNDKndOqqTtYsaMt5ixO6oPWKQ81qKuvXxRRdHYXuQQCJbUyhHseimcD5NP9nO0Z9rO TEx0dDj0Tl6zMo+SDCcU1ZOFrofVCMlAXlbwCeoSPKKpLNKFfKNr9uN7bUFvMi0JXWou VrQxRk5RSn76qZwGKlpdgRUBqNk2ehmu0KaViyQhH84s2z6TrVrXeHnLZB0Lctun7i89 nSDjnnpOIrG0umiwKkBAT0HaDXB09AdLim27437W71q8JZ+Fckl+iHtvaJiEhihJmdMG 9TDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a6540cb000000b0055c993fe858si1704093pgp.892.2023.07.27.13.48.36; Thu, 27 Jul 2023 13:48:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232384AbjG0UYW (ORCPT + 99 others); Thu, 27 Jul 2023 16:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbjG0UYV (ORCPT ); Thu, 27 Jul 2023 16:24:21 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA473AA9; Thu, 27 Jul 2023 13:24:01 -0700 (PDT) X-QQ-mid: bizesmtp89t1690489430taupjqmr Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:23:49 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: 7YFKcddXagjClmzXEeTqsqBAti0I7zGcNw3o74NJMlrB+NIXdu4Mxu64pWeI9 GijqOI4AwCKaIHI/71zr/Ho8fvrwScEzDbge6LU/OzZVI8OcxxnXpE5/C7HW6mgyrxWjGNO w1Xc/7vadlLRWh2EbZ0ka+sr5L8ZEwX55NLKhW+bY31wiI9scpTopIQKJqCmPFjoSFkukjr l6LBxQwXlEOFL36ga555U6uaXkPq15LVx8sYhIPctX5dgTWtDCwJoeut+40i9e8ufwdJ4gT ZyuJF/u28VGFLMo+cKSoC/+kKerNQKF7vNPXdTX+1djVsLZqQDGYjkxAFUxHkVcIRQzhor3 KSTH0IHJMUn9ztJ3QB32ky7Ud4fZIW9voWqvJocuRGvKnn1RZLBJLNtxmpKyAdsQofJuila X-QQ-GoodBg: 0 X-BIZMAIL-ID: 1357808437858265146 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 02/12] selftests/nolibc: add macros to reduce duplicated changes Date: Fri, 28 Jul 2023 04:23:49 +0800 Message-Id: <7d033dcf0bc499de1269af8b436133733a1710f1.1690489039.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772608216731821600 X-GMAIL-MSGID: 1772608216731821600 The kernel targets share the same kernel make operations, the same .config file, the same kernel image, add MAKE_KERNEL, KERNEL_CONFIG and KERNEL_IMAGE for them. Many targets use the same log file, add RUN_OUT to allow save log by architecture, for example: 'make RUN_OUT=$PWD/run.$arch.out'. The qemu run/rerun targets share the same qemu system run command, add QEMU_SYSTEM_RUN for them. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/lkml/20230722122009.GE17311@1wt.eu/ Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 41 ++++++++++++++++--------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 75419b695f0d..bfea1ea0b4e7 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -169,47 +169,58 @@ endif libc-test: nolibc-test.c $(QUIET_CC)$(CC) -o $@ $< +# common macros for logging +RUN_OUT = $(CURDIR)/run.out + # local libc-test run-libc-test: libc-test - $(Q)./libc-test > "$(CURDIR)/run.out" || : - $(Q)$(REPORT) $(CURDIR)/run.out + $(Q)./libc-test > "$(RUN_OUT)" || : + $(Q)$(REPORT) "$(RUN_OUT)" # local nolibc-test run-nolibc-test: nolibc-test - $(Q)./nolibc-test > "$(CURDIR)/run.out" || : - $(Q)$(REPORT) $(CURDIR)/run.out + $(Q)./nolibc-test > "$(RUN_OUT)" || : + $(Q)$(REPORT) "$(RUN_OUT)" # qemu user-land test run-user: nolibc-test - $(Q)qemu-$(QEMU_ARCH) ./nolibc-test > "$(CURDIR)/run.out" || : - $(Q)$(REPORT) $(CURDIR)/run.out + $(Q)qemu-$(QEMU_ARCH) ./nolibc-test > "$(RUN_OUT)" || : + $(Q)$(REPORT) "$(RUN_OUT)" initramfs: nolibc-test $(QUIET_MKDIR)mkdir -p initramfs $(call QUIET_INSTALL, initramfs/init) $(Q)cp nolibc-test initramfs/init +# common macros for kernel targets +MAKE_KERNEL = $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) +KERNEL_CONFIG = $(srctree)/.config +KERNEL_IMAGE = $(srctree)/$(IMAGE) + defconfig: - $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare - $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(srctree)" -m "$(srctree)/.config" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) - $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) KCONFIG_ALLCONFIG="$(srctree)/.config" allnoconfig + $(Q)$(MAKE_KERNEL) mrproper $(DEFCONFIG) prepare + $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(srctree)" -m "$(KERNEL_CONFIG)" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) + $(Q)$(MAKE_KERNEL) KCONFIG_ALLCONFIG="$(KERNEL_CONFIG)" allnoconfig kernel: initramfs - $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs + $(Q)$(MAKE_KERNEL) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs + +# common macros for qemu run/rerun targets +QEMU_SYSTEM_RUN = qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(KERNEL_IMAGE)" -serial stdio $(QEMU_ARGS) # run the tests after building the kernel run: kernel - $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" - $(Q)$(REPORT) $(CURDIR)/run.out + $(Q)$(QEMU_SYSTEM_RUN) > "$(RUN_OUT)" + $(Q)$(REPORT) "$(RUN_OUT)" # re-run the tests from an existing kernel rerun: - $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" - $(Q)$(REPORT) $(CURDIR)/run.out + $(Q)$(QEMU_SYSTEM_RUN) > "$(RUN_OUT)" + $(Q)$(REPORT) "$(RUN_OUT)" # report with existing test log report: - $(Q)$(REPORT_RUN_OUT) + $(Q)$(REPORT) "$(RUN_OUT)" clean: $(call QUIET_CLEAN, sysroot) From patchwork Thu Jul 27 20:24:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:d09a:b0:134:c3fc:3153 with SMTP id jc26csp184280rwb; Thu, 27 Jul 2023 13:37:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlFw3+Of4W0vvJzmq8iPogLL5fPHVf5IwTqGsAvs7/lo0vqYX1BGTuabaJE/XPSmQ1yoG+c5 X-Received: by 2002:aa7:c85a:0:b0:522:5a05:6011 with SMTP id g26-20020aa7c85a000000b005225a056011mr100978edt.0.1690490230158; Thu, 27 Jul 2023 13:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690490230; cv=none; d=google.com; s=arc-20160816; b=oTglUeBtjNLeuuvdpmhE4842rpInqsMI78EbQduqlic84CMzghNsmVry/Gc3k/VoAU 6ntoOXtaG60ICVzINsPtfLhHB3Y1DKHtKMkJ3BO5wQKboiVIM8i4fKx/ekSZFa5rKhWf SwOwzQCyknetOjRSwJ399U8aKyHWMLses3+pGscmPApcG+l4P89m2/vxRkoMugQXoui4 pXzdZ2UklPyp9+M0C1tCf+LixarbmQ/K18O0NEcrNMchOEsi9epq38aZiMWcKyUA42aS +v5Toys0hczxKOJ+3Rb/gKYAAAb5yyNJIugduiD37sT3ZhTI2WE/DLCYesPkk3AnCSef HOsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Zak/nA1BGAQZiVaFY4IuFJykCRHG5SFujUsDczLyul0=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=FbY958bHX8QQAv8d1+FIyCPJzi1P8yRKq5S16OWQzztyAWokE+zTv7iEzi82FPGSCq yGxCeaqAWk+vhkHtes9Vh8T4MdWlqXIuwsz0JNjOVeXJKEQXOyzAUpONpYtK2z//VZV6 6WuNXvqNLHu+AXfJwHMLZ4ipt7nFuPgv03m0281zb6v9IqpUR9YxYM2VecKq+BnS2L+V hNQgPLoI0EjYCjIJVifEt6/txJTTBdcGkiVYg6spiotOFGIcpTkaDt/x9Q6L9NJYHPTp jI0NI0xQvmzLKIooMZ5yfgK8Y0CcjVMmQ8USh+AZoZ0OgB9r1GVg3NbRR8xeVzSzs/6I SamQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a056402124100b005222a66a953si1266644edw.627.2023.07.27.13.36.46; Thu, 27 Jul 2023 13:37:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232399AbjG0UZK (ORCPT + 99 others); Thu, 27 Jul 2023 16:25:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjG0UZI (ORCPT ); Thu, 27 Jul 2023 16:25:08 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32ECD213A; Thu, 27 Jul 2023 13:25:07 -0700 (PDT) X-QQ-mid: bizesmtp76t1690489498tn31pf5y Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:24:56 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: OFQdrTmJ2CT0tv/k26zD61DgunIr3+i0gone8E+YGqdNlrN1NMVMfNlBeM907 QHYMz8CJvGbNGo2HcSksGZidroSyt7+Jq0dU4tKx5ZZiLbBmsl82jsZXPz/fIp7su2ohykc 554yQkRI4nz5yiK3mB6DzQ4AUpgeLhpu3NvDkupV1A4BbpHKbl+nPP2OAKUDI22ThM7qUKK flti2txnb6ObvovHXy8v5rve33RQFJdVlo49Y31TT1pCPBQgSu2+DxtHvQf9Pb/7F5LC0/d vCjccB3olddvLIM1bmTiA+Wf3Hb76B0A27Y0PylTN7gPtLhNMevIhh9v1KvAmL8lQjHWUUA DhqwfpUhbSJaTlO3jnl/uFVJDaGyBW5Ij8WS61t2uqI0G7jdJzG3DM/UvtLyQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6039361887706887061 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 03/12] selftests/nolibc: fix up O= option support Date: Fri, 28 Jul 2023 04:24:56 +0800 Message-Id: <1da6cedc8a7232833dbb7aaada5ae9df3e60ed7e.1690489039.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772607483524731048 X-GMAIL-MSGID: 1772607483524731048 To avoid pollute the source code tree and avoid mrproper for every architecture switch, the O= argument must be supported. Both IMAGE and .config are from the building directory, let's use objtree instead of srctree for them. If no O= option specified, means building kernel in source code tree, objtree should be srctree in such case. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/lkml/ZK0AB1OXH1s2xYsh@1wt.eu/ Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index bfea1ea0b4e7..f5680b9ed85c 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -9,6 +9,9 @@ ifeq ($(srctree),) srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR))) endif +# add objtree for O= argument, required by IMAGE and .config +objtree ?= $(srctree) + ifeq ($(ARCH),) include $(srctree)/scripts/subarch.include ARCH = $(SUBARCH) @@ -194,12 +197,12 @@ initramfs: nolibc-test # common macros for kernel targets MAKE_KERNEL = $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) -KERNEL_CONFIG = $(srctree)/.config -KERNEL_IMAGE = $(srctree)/$(IMAGE) +KERNEL_CONFIG = $(objtree)/.config +KERNEL_IMAGE = $(objtree)/$(IMAGE) defconfig: $(Q)$(MAKE_KERNEL) mrproper $(DEFCONFIG) prepare - $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(srctree)" -m "$(KERNEL_CONFIG)" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) + $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(objtree)" -m "$(KERNEL_CONFIG)" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) $(Q)$(MAKE_KERNEL) KCONFIG_ALLCONFIG="$(KERNEL_CONFIG)" allnoconfig kernel: initramfs From patchwork Thu Jul 27 20:26:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127189 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp19414vqg; Thu, 27 Jul 2023 14:24:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlHpq6Ud9A1YaKdKa4GcoIvUmVdujljq+NPbiY3berrD9C7G39f82Ugg5niByziQQ0JL0z4h X-Received: by 2002:aa7:8881:0:b0:66f:578c:59fb with SMTP id z1-20020aa78881000000b0066f578c59fbmr386573pfe.10.1690493057261; Thu, 27 Jul 2023 14:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690493057; cv=none; d=google.com; s=arc-20160816; b=ykdIE7208CoerZvH/qhGHlB56cd3CIylxIxs5hnbB9O6nPoncq6S7L54Gx5rWSn84P 9b/dnLS3rZBq5Tri+tZ/c44L979VrG919DoXDnNTTALPYqodL3huUcWytcWSqI6F1rJA 5kMnVxgiFyOmMntnP0K9sxhpTPoGS6rraS9tWEhxHEHXi3OmHEiwbg1vgpgGiKH/NCeX bOXqWTdMv9d73HFJ3dfRD11IN/LchSD6Jj88dkGFPCEGmiu4pl47tqKmgXkdB4MD7Xy2 yL/fyXMFmyuZKFUXfBM1JTERcp9NYOKxa+B4qG72UxkD7WgWvcLfIL42fDDcbJuCABdy Ighg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=h0tCBf299K30sC0Uy1ZJVyJ72cguZnUxoHCTRAspGOg=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=FXyodtM+f0dAbpH1tD+qkIx6JwdPEyqCS3zfD5FLHiQEqStID90JZtLpq0iuQ3ZGhR dbQe7ANV49ztrd89jLU/402iA2+rMcAKkCBrelnZlOK+UI0nkzprsbWtOZuGIbOi+N/A ffZfp1WqxzMiWCDoNGTlYI92HV7zOP3QKd2S6iwEsyY/J6JcP5L16TNMUelCQw/ZTg9H B5GPq4IeYYiemcUrp7aNbmyCVkIx79R9vvEnFDfIwNEkXgepm257l0dgWHStME/Jnyic CIq2KPYhxZSeWZv0epeDvPOhplEzi25Nre5mPJisjDB7zQLD0ap8gKu/IwzJ/6anHBMT UVQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx11-20020a056a00428b00b0067ea76a7c59si1906288pfb.50.2023.07.27.14.24.03; Thu, 27 Jul 2023 14:24:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231515AbjG0UcS (ORCPT + 99 others); Thu, 27 Jul 2023 16:32:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbjG0UcK (ORCPT ); Thu, 27 Jul 2023 16:32:10 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0B7930F5; Thu, 27 Jul 2023 13:32:00 -0700 (PDT) X-QQ-mid: bizesmtp65t1690489565tg42khc4 Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:26:04 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: SO65WgIymiHJ7FcToC7kLxdI0mhJp0wkOEo+Sirw0umysYn9kh0wsqMc5pGqj kO1TSVq8llQr9cwcIYvv7VfJgl3PSzINEZkitkWxZFiiueP0GsxyyrOCe3tOx7Gnu8k7B4d 3dc/Ur36CeAh0rcHzK0EWcasxUczJP8IlemGAFgUj0CUnX7V0JrPeJwZlxg0cZYfJA0xnL8 i2r01JxV/uZh/dfEvSg9ODOD716/+Vu5vvDay73TO1PXlevJDttZYOzabewiCuZL0R3Ng+/ wMpZqSlgytjC21/r9RukLL8G8gdKvCzVzVSra6JhSHt4cAMhM4i1NoBsJ7CHzAxollzipHv 2GOnQ6uWxXlivYeq8+5I+StbFQFwasQphaGSkBgMd3K+FoVk9C9hGX4X3DcQi3LF6jrK4yV X-QQ-GoodBg: 0 X-BIZMAIL-ID: 17663128529755387531 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 04/12] selftests/nolibc: string the core targets Date: Fri, 28 Jul 2023 04:26:03 +0800 Message-Id: <9b52e26748eda1ac108d569207bf428bf37b3bbc.1690489039.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772610447938443611 X-GMAIL-MSGID: 1772610447938443611 To avoid run targets one by one manually and boringly, let's string them with IMAGE and .config, the MAKE command will trigger the dependencies for us. Note, defconfig target is only triggered while the .config is not there, it means only trigger defconfig for the first run or after a mrproper. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/lkml/20230725142017.37103-1-falcon@tinylab.org/ Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index f5680b9ed85c..3a61fa7e42a0 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -153,6 +153,7 @@ all: run sysroot: sysroot/$(ARCH)/include +PHONY = sysroot/$(ARCH)/include sysroot/$(ARCH)/include: $(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot $(QUIET_MKDIR)mkdir -p sysroot @@ -205,14 +206,21 @@ defconfig: $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(objtree)" -m "$(KERNEL_CONFIG)" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) $(Q)$(MAKE_KERNEL) KCONFIG_ALLCONFIG="$(KERNEL_CONFIG)" allnoconfig -kernel: initramfs +PHONY += $(KERNEL_CONFIG) +$(KERNEL_CONFIG): + $(Q)if [ ! -f "$(KERNEL_CONFIG)" ]; then $(MAKE) --no-print-directory defconfig; fi + +kernel: $(KERNEL_CONFIG) + $(Q)$(MAKE) --no-print-directory initramfs $(Q)$(MAKE_KERNEL) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs # common macros for qemu run/rerun targets QEMU_SYSTEM_RUN = qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(KERNEL_IMAGE)" -serial stdio $(QEMU_ARGS) # run the tests after building the kernel -run: kernel +PHONY += $(KERNEL_IMAGE) +$(KERNEL_IMAGE): kernel +run: $(KERNEL_IMAGE) $(Q)$(QEMU_SYSTEM_RUN) > "$(RUN_OUT)" $(Q)$(REPORT) "$(RUN_OUT)" @@ -237,4 +245,4 @@ clean: $(call QUIET_CLEAN, run.out) $(Q)rm -rf run.out -.PHONY: sysroot/$(ARCH)/include +.PHONY: $(PHONY) From patchwork Thu Jul 27 20:27:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:d09a:b0:134:c3fc:3153 with SMTP id jc26csp184154rwb; Thu, 27 Jul 2023 13:36:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHTPfP82tZEMPqFd2H+IYYYg594qtJClv3RN2MBczYUsKDdYWHauKWigqV+fqv4q2AaRWzG X-Received: by 2002:aa7:d549:0:b0:522:3855:7ec5 with SMTP id u9-20020aa7d549000000b0052238557ec5mr92009edr.10.1690490212773; Thu, 27 Jul 2023 13:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690490212; cv=none; d=google.com; s=arc-20160816; b=JeFwKEkRWgRC7AYJcB6sSHj5xilJ437Wu7z9nfbo2B97NCUtj9mHzxyBr9Jk3MLf/F LkXMmHn439s0eofcc2xgyAG4seE/dF2YgjggAt3UUhadOQ9C57FOHpeFZo+sZUR8DmKC iUh2H9923DQKpPaHy31P+y4oZ6rGyJUv4jdKnQzRy2XgJH8scDubiUcLUYa4fwwAIbEg iFP2Icd9W+Ax9hnJEIupYBMIUgQMKDPqJ+53af1IpDJA6QFcHCbYEoGOeb+xn08U7J3h lvXs3e51MhPOGTRlnaTdJZmuuk0jhHKZutEWmenszwfEOQ1mfCXnfSL/WVJ45fXkSdWS hKtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=51R5/kVFjW56TFpEjpObFKDi4cUPorUXKCBH1LShTho=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=FuPJTnEy/oWhRDpC8C2a4UNP7/P2kNLFlel71i0TJiEg8pLqQyZaeBOFgWs8j0gCcx X3EbkAyAdH2GxaaPjWKnszhxc0TZ3URSB3UgpRzyuW3AnXvkfG4ceEeZj5U+7QgsF3vE GpRr6atq25XWTjKg4rtPuqC2fFj0dvba9bbQgoolvxqzevdU1X74/uUbA1V78aTv7yr6 MkRQdqT+BX9eUeAzdapBLGNIt/SnbJo1F7srFYJIVVvCtQjZuCKAMJV6BmawtK0ltHzA mEOZjT8x7Ve3px7ScQKHuqLP/FgQ81mK/g5Y23hrpNiDttWkOqxmI+vk2stc1GbL9bK5 meAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a25-20020a50e719000000b0051e52d264b6si1533107edn.236.2023.07.27.13.36.29; Thu, 27 Jul 2023 13:36:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbjG0U2O (ORCPT + 99 others); Thu, 27 Jul 2023 16:28:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231248AbjG0U16 (ORCPT ); Thu, 27 Jul 2023 16:27:58 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C409C30CD; Thu, 27 Jul 2023 13:27:39 -0700 (PDT) X-QQ-mid: bizesmtp70t1690489632tls6eljb Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:27:11 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: 3M0okmaRx3gIqvGRracM+M018bYz/CeLA38os0ZqnkmoJW4wVgNSRIQZdhvX6 5EL3U0qRh1Axy5sg9nEMQa38Xh1XKzC3OxtnQ5dPOq/ijA/xvg4dJGdWt09QYM8U6n1AeOO gWyTYSsHDZ8DyuU9ABRFFQUF8o6y9L+bcrYPZ45mBij+b4Jt6Qcsx52aQVkbgkGXoqwQVKE 2hbxOFotjr3YrNdj7gQHjgIsXMs7fKzDwgxwnckcRnGOjpsGNj7AH9X7LQbdvH3F72D5ZxN Om1OiM1U+BEAu/CEPdnCykyL2Z2kJ4Z370aR0Jg3WG30L1+ED5CpK57rgYiqO0oaEcIr58I BISGpTKi5+LFxkX/uBje4OCPzEVcwl4ue7TkGUJFKN5XXAojYn6Xfrkf9QtPw== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 7483023099886591231 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 05/12] selftests/nolibc: allow customize CROSS_COMPILE by architecture Date: Fri, 28 Jul 2023 04:27:10 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772607464954099270 X-GMAIL-MSGID: 1772607464954099270 Some cross compilers may not just be prefixed with ARCH, customize them by architecture may simplify the test a lot, especially, when iterate with ARCH. After customizing this for every architecture, the minimal test argument will be architecture itself, no CROSS_COMPILE required to be passed. If the prefix of installed cross compiler is not the same as the one customized, we can also pass CROSS_COMPILE as before or even pass CROSS_COMPILE_. Signed-off-by: Zhangjin Wu --- 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 3a61fa7e42a0..3f15c7f7ef76 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -45,6 +45,12 @@ IMAGE_loongarch = arch/loongarch/boot/vmlinuz.efi IMAGE = $(IMAGE_$(XARCH)) IMAGE_NAME = $(notdir $(IMAGE)) +# CROSS_COMPILE: cross toolchain prefix by architecture +CROSS_COMPILE ?= $(CROSS_COMPILE_$(XARCH)) + +# make sure CC is prefixed with CROSS_COMPILE +$(call allow-override,CC,$(CROSS_COMPILE)gcc) + # default kernel configurations that appear to be usable DEFCONFIG_i386 = defconfig DEFCONFIG_x86_64 = defconfig From patchwork Thu Jul 27 20:28:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127168 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp6980vqg; Thu, 27 Jul 2023 13:53:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlHWhf4kvQpTPxS7T+3Wh7OlIwGCOOIC/wCcDcgDEBQ/sNLLTK3tUsmMnl3Sph1Jia3T0COw X-Received: by 2002:a17:903:1112:b0:1b8:af85:e959 with SMTP id n18-20020a170903111200b001b8af85e959mr482730plh.53.1690491232110; Thu, 27 Jul 2023 13:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690491232; cv=none; d=google.com; s=arc-20160816; b=TG4pqGkb+VP8M1unrWBiBr3vnCw8cBwz/vbh+5sdeAGDgKxRTrQT2z32G1aPKTXDzW 5PZgBRpvrgWoRrA+52bJVzA9IRsKcuL6m/trAInEciRrwCFuhG3VWaXxYW0qRAO4hCFd CEwBip9/76EW68BZDuMzWdB7iRrJsFbZZUUtt+tIabfIvoSf3keYcMbBD1jMA0JptUk9 djCGYLj4gMNcy5mVz0B1eylPkEUHWkLIJXjPhYWIvYuyuf3sd/O7fsR99nnlQbxl4gSC KTcxIXLGigVFgYN4hA8ZYpX5qDd2I2TYB3zPgLyFVvYs3xIjEgCdawE/YvNOtfUotcX1 /Nxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=LRBF+KWDBpGQonVqjmFHEpcpUIAKzetQombUOMN8GCI=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=ZclbQewFtT9+KNq37OgB0zn+uYvtqWAi53HXQLkd8RsapXYTxQrl8lpq7+TelpwFDw bPdXxJM6VmNICuyGdoR8ovejziIMyECt3yA0ID3IGEJs2idMTC6qSMORixLejL8Hr5Dr h1g3RwWfosii1mSWXfmmp9nH8jsypg6G7eUB0oQcAe3j0uxUmJPeoiEFhAn+SwnGgwjG bPfvzh9SoD1aGaP3ggRyOvg+YnyGqq/eVotK2oQogpC4PVQh2Ul5KcZ4KXvwBnRahTS0 g7qIO3U9TTQdd5LiBAQCbaJNE9NksKs7Je9y8SxgA/RU+Ln7Zhdw2nFIEGCjbdBWyN4n HESA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p9-20020a170902e74900b001b87bd2f7b0si1886075plf.402.2023.07.27.13.53.37; Thu, 27 Jul 2023 13:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229437AbjG0U2d (ORCPT + 99 others); Thu, 27 Jul 2023 16:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230049AbjG0U2b (ORCPT ); Thu, 27 Jul 2023 16:28:31 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 861CE30CD; Thu, 27 Jul 2023 13:28:28 -0700 (PDT) X-QQ-mid: bizesmtp77t1690489698t82ph8cm Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:28:17 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: dKvkn8qoLrE2yLn96qy5k0fzTpwuyKtkiBSpI4LwdFyOeVirP6jaXvT0wq5IB lyhlNscOT+zA2kHB7tqoZ7sJwvbTr525TCosc7zMPGfENlCjXaycc0d9ITayDt+FcvVnqoa CYH8kqgk62UIvsOM6IRf45fZm/tD16k4QVwCphU4X6zJSbEt3vx4jGjLm2aCkaZ0J3EdBhi 7B+qe6+RI/NJPVFoMTuzy+BKEtxQcWXRqOEGuzqmBtamF70BLvlykk4dHD5nh7usejRRyLB JCBuYBm7V062gzUOMueR6pXzenYc9e5+ti7FqyhKWD/TTxpPm7P7gsGppuRl9ksU7QLJfXx KcL5CCZD+J3JP9LDFEiXmJZhnWcgiXe2saCrF9nZ6UbWxScnTXfUrYeU7FLGvh2Jk8EGX/e X-QQ-GoodBg: 0 X-BIZMAIL-ID: 16216814846800268763 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 06/12] selftests/nolibc: customize CROSS_COMPILE for 32/64-bit powerpc Date: Fri, 28 Jul 2023 04:28:17 +0800 Message-Id: <41e2aa9e4299dd35cfeef9fecc2a6a02a7b49d90.1690489039.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772608534111643735 X-GMAIL-MSGID: 1772608534111643735 The little-endian powerpc64le compilers provided by Ubuntu and Fedora are able to compile big endian kernel and big endian nolibc-test [1]. These default CROSS_COMPILE settings allow to test target architectures with: $ cd /path/to/tools/testing/selftests/nolibc/ $ for arch in ppc ppc64 ppc64le; do \ make run-user ARCH=$arch | grep "status: "; \ done If want to use another cross compiler, please simply pass CROSS_COMPILE or CC as before. For example, it is able to build 64-bit nolibc-test with the big endian powerpc64-linux-gcc crosstool from [2]: $ wget -c https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.1.0/x86_64-gcc-13.1.0-nolibc-powerpc64-linux.tar.xz $ tar xvf x86_64-gcc-13.1.0-nolibc-powerpc64-linux.tar.xz $ export PATH=$PWD/gcc-13.1.0-nolibc/powerpc64-linux/bin/:$PATH $ export CROSS_COMPILE_ppc64=powerpc64-linux- $ export CROSS_COMPILE_ppc64le=powerpc64-linux- $ for arch in ppc64 ppc64le; do \ make run-user ARCH=$arch | grep "status: "; \ done Or specify CC directly with full path: $ export CC=$PWD/gcc-13.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc $ for arch in ppc64 ppc64le; do \ make run-user ARCH=$arch | grep "status: "; \ done [1]: https://github.com/open-power/skiboot [2]: https://mirrors.edge.kernel.org/pub/tools/crosstool/ Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 3f15c7f7ef76..6385915d16c9 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -46,6 +46,9 @@ IMAGE = $(IMAGE_$(XARCH)) IMAGE_NAME = $(notdir $(IMAGE)) # CROSS_COMPILE: cross toolchain prefix by architecture +CROSS_COMPILE_ppc ?= powerpc-linux-gnu- +CROSS_COMPILE_ppc64 ?= powerpc64le-linux-gnu- +CROSS_COMPILE_ppc64le ?= powerpc64le-linux-gnu- CROSS_COMPILE ?= $(CROSS_COMPILE_$(XARCH)) # make sure CC is prefixed with CROSS_COMPILE From patchwork Thu Jul 27 20:29:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:d09a:b0:134:c3fc:3153 with SMTP id jc26csp185151rwb; Thu, 27 Jul 2023 13:39:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlG4vvHczhOnsIhGAWDr0f2Nk/8nKZsG9jhwvbYzgGVFyiLy9jRYhWpPWTO1HagaGyUeTifC X-Received: by 2002:aa7:d4d6:0:b0:522:214c:516 with SMTP id t22-20020aa7d4d6000000b00522214c0516mr52382edr.42.1690490354614; Thu, 27 Jul 2023 13:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690490354; cv=none; d=google.com; s=arc-20160816; b=zA9IrjM91x21VVVPIIHLCSkNZh3BZsUWZD6+hSXDDWnKNS97nbnHx/uZHM+b6lF7Va ZSi+EHCoSXG/1cfk1WM8S/dS3yhv4oMiV4QHjA+pL6eOD7ca8h75sopTlWOyKYYZ7zeU D4SiMCtwg9VpCe0lklZV8e9jDIZB9gnVOvxStXVycGq4J8TXOljHhWDMFgyf3qdKghy6 GI1j1gyNgck6ot8m76zAPuGSyaBGEh37HSFIguslYPmcw8D20BaU891S76simOi3gTlb 7G/tD9iZ/rd5gwsnWqmAOny77WV1TyytFheEPopOMHr25C0Fc4Uwq96/v1ByyQ/iTvbA 7QvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=jCMqmw6cLqU8M5itJWcByLcRXrfHP3sDg5TCFvxaHWU=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=w488OIObF293lk0KDIazlm/SwxCf6ONrej4vtX0p+LE5gxn0PMoFvCDKmBvo5DQeNR hSsplrsHCa47aDLcmvJ29gxcbkfd13DhHP3Oh4CzTjLkV11HcJWBr15gfny16y6B4eCx ewlB3mNdVfvBcIB0+X4AvskfuaHra4kVtmvLIxjzhpyVoufb1GPMZ9z3l4A3Jh0mZbIY yFkYOuy9bxvs8rZsq0C0EWkRcSiW8ltF7T6PnwwtswyKmH0X7b38XW6s/mwHbJyi5+BS nxmsrXOEPR3y/I5OxPQdRb2j6LtHnOSwu6xTmkfsG97H90OLOAhwJmTU21EE8eiBdVn6 oppw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a25-20020a50e719000000b0051e52d264b6si1533107edn.236.2023.07.27.13.38.49; Thu, 27 Jul 2023 13:39:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230043AbjG0U3i (ORCPT + 99 others); Thu, 27 Jul 2023 16:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjG0U3h (ORCPT ); Thu, 27 Jul 2023 16:29:37 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A5BC2688; Thu, 27 Jul 2023 13:29:35 -0700 (PDT) X-QQ-mid: bizesmtp65t1690489766t9v338bu Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:29:25 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: 3M0okmaRx3hs8KjjHXgV3Mnz1SbuFa76sKO20ziBuLGO5QLIvoP9RFy4OEgee Cy0+ZWIn7BRQWovusTQnisGvElCqSK+hdthX7FIZJa0rDEywrtYE9JwNPGXNfugDB1nTF7U +JD/jIMyAb7+eEg0Bn/XSgdSX5NQVY0+YUYRJWS4/IHQE1Ym0tZSaJxcMRrXSsP6FflLo58 ld499Ozr6Eo+sFi2CqSszJD/SCrP5OBpOuy7ATwW2fq0QokE/CUxRfcyR92DNJ5NFMCuU7c TAx3dnUznunh2zaCrxSAqWa6uSZUfImNSRnq/BT2eRS9LgbGmvO6jNZ56OyddZZ0bBhKyOE iCrVoZGvHR+BjNUKyxKqLGA7XIeg1nMUOzYarGvfLMWgJIkVJCEtrVdioJdpq2hM3UldzBO X-QQ-GoodBg: 0 X-BIZMAIL-ID: 17253053822244597306 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 07/12] selftests/nolibc: add menuconfig and mrproper for development Date: Fri, 28 Jul 2023 04:29:24 +0800 Message-Id: <45c0c24e77f4ae78ac3ace099f2e6678d15456e0.1690489039.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772607613880837772 X-GMAIL-MSGID: 1772607613880837772 menuconfig and mrproper are frequently used operations during a new architecture porting, testing or debugging. menuconfig is required to tune and test extra kernel config options for tinyconfig. mrproper is required to get a clean srctree while want to start a new building with O= option, the old generated files in srctree must be mrproper-ed. differ from local nolibc targets, the menuconfig and mrproper targets from top-level Makefile accept different ARCH variable and require extra '-C /path/to/srctree', which make development not consistent and therefore very painful, let's add local menuconfig and mrproper targets too. To reduce duplicated entries, menuconfig and mrproper are added together. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 6385915d16c9..a214745e0f3e 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -215,6 +215,9 @@ defconfig: $(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(objtree)" -m "$(KERNEL_CONFIG)" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c)) $(Q)$(MAKE_KERNEL) KCONFIG_ALLCONFIG="$(KERNEL_CONFIG)" allnoconfig +menuconfig mrproper: + $(Q)$(MAKE_KERNEL) $@ + PHONY += $(KERNEL_CONFIG) $(KERNEL_CONFIG): $(Q)if [ ! -f "$(KERNEL_CONFIG)" ]; then $(MAKE) --no-print-directory defconfig; fi From patchwork Thu Jul 27 20:30:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127166 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:d09a:b0:134:c3fc:3153 with SMTP id jc26csp190026rwb; Thu, 27 Jul 2023 13:49:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlFTVpWiqRYUao6nUoW6bDihCLtEVgfSocnOnu8WHD9hH7yIZkL5XxdtdFtSrTgjjmOQJX+T X-Received: by 2002:a05:6a21:3392:b0:133:5f6a:fb6 with SMTP id yy18-20020a056a21339200b001335f6a0fb6mr245170pzb.1.1690490969157; Thu, 27 Jul 2023 13:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690490969; cv=none; d=google.com; s=arc-20160816; b=nmp7gqakLodXdi9rmLdylWAfuQ/UbiYzsVSHz7JYpwEI8eRbjuTNliuk6i9Ae6NlnU T2+sUW75r+Er+4Nj9rZxQY1I9I4c0bfCiyzlFjMVyyTWWalkgU/buqOe7JrF15HCEwBG PQM4C9ImB6nLLQNjBw76kXrx8QLQiMsj8OVJ39LpgK6J8Yboyn3zyfvHgw6bsa394rPt 3Q3S02jNX58yKEi/ft6WCqCGGwPgTt9KnaDs4++saVNfgp6VoQqPIzdXtmzh3HvX7vcd XXox+zgqlNcO9GoLnXG0MqHG+aq/cAvE6oUC3EoKIA0Bu4LmzQiR4Fbd4eN3/LxySpVC Z2zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=C0YzCn4LVD+emf+zdHtZhextI5R9pLIWIAWh5lB1JCY=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=hLP2LpA4q+HVatl6RbUDRyPrdEj8p+0VaZhKv89vvEybM8wnUt4J3Xby7MS43ezfGH NckHZBUflZ13k5XRLtA0866+sxI0xHyNyyRkJNuRnOXxFCcSzhq/ZTEgp4ASPKg5wZCc ihubUv7od2UHD7YijYDzQ2bwSYLmCsU8C1Q5LLqg2IHgt6bxKxPwtFOR6S3r9z59yXAX BEICN9YdzUxGmE48oDhXhYXA2JYJ6q3XyJIh4Zi+qXBtQoCHkXFd9NF/uwkjX3Xpg2Qq NXIClxPfySuaCUcDoGCPTvm5ZNRtE/5+3jarlPTRR45hR4G0zkRaqQGITU2IIkdvYwIU gCwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bu16-20020a632950000000b00563b7d87d83si1679501pgb.424.2023.07.27.13.49.16; Thu, 27 Jul 2023 13:49:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230478AbjG0Uaz (ORCPT + 99 others); Thu, 27 Jul 2023 16:30:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbjG0Uaw (ORCPT ); Thu, 27 Jul 2023 16:30:52 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F37BB30E4; Thu, 27 Jul 2023 13:30:42 -0700 (PDT) X-QQ-mid: bizesmtp89t1690489832t5sr73z5 Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:30:31 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: pmyeiOl6PGn82x4eFXPNEITOuWWU+TvnNm56XXJBynRue1cBZR4uW6sldlrWd 4avjCims+5xy9Qf/PYidPSKOOcbnAkxppQvdPEejuwpc4PM6jyWFcyZTUuDqVJdJ5JmoooI jL/XkwNL1y1hjcw8FyqydaCs4yicA/VuDE3SFw6wgCvkTXIyWQZt4DRiLIMNPr6eEUD+m72 f+xek+riwnuTGiwPrYymmfQffQqEBn7xLjaQbhA9sfEOtixwjGr0uWR3dBgWyKcpPJduAeb K2hMuJGt0tN6UMAuv3o32/8NH0U0c6Xm8snJ0+XJly6iTA9nuPqlwdvO8mQAPAd/qr53uSM 1WulUhXMoKeKR1ocG/O6MNH8ckx1LbDykelL+Evnc/anK0xbMA1VPoKqamurc2uMWMOEz1E X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6404872216917566907 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 08/12] selftests/nolibc: allow quit qemu-system when poweroff fails Date: Fri, 28 Jul 2023 04:30:31 +0800 Message-Id: <4b4d792299ca5356f8f5af5fc9a27c687b0e4e38.1690489039.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772608258938133082 X-GMAIL-MSGID: 1772608258938133082 The kernel of some architectures can not poweroff qemu-system normally, especially for tinyconfig. Some architectures may have no kernel poweroff support, the others may require more kernel config options and therefore slow down the tinyconfig build and test. and also, it's very hard (and some even not possible) to find out the exact poweroff related kernel config options for every architecture. Since the low-level poweroff support is heavily kernel & qemu dependent, it is not that critical to both nolibc and nolibc-test, let's simply ignore the poweroff required kernel config options for tinyconfig (and even for defconfig) and quit qemu-system after a specified timeout or with an expected system halt or poweroff string (these strings mean our reboot() library routine is perfectly ok). QEMU_TIMEOUT can be configured for every architecture based on their time cost requirement of bios boot + kernel boot + test + poweroff. By default, 10 seconds timeout is configured, this is enough for most of the architectures, otherwise, customize one by architecture. To tell users the test running progress in time, some critical running status are also printed and detected. Suggested-by: Willy Tarreau Link: https://lore.kernel.org/lkml/20230722130248.GK17311@1wt.eu/ Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 30 +++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index a214745e0f3e..9a57de3b283c 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -105,6 +105,9 @@ QEMU_ARGS_s390 = -M s390-ccw-virtio -m 1G -append "console=ttyS0 panic=-1 QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS = $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_EXTRA) +# QEMU_TIMEOUT: some architectures can not poweroff normally, especially for tinyconfig +QEMU_TIMEOUT = $(or $(QEMU_TIMEOUT_$(XARCH)),10) + # OUTPUT is only set when run from the main makefile, otherwise # it defaults to this nolibc directory. OUTPUT ?= $(CURDIR)/ @@ -229,16 +232,39 @@ kernel: $(KERNEL_CONFIG) # common macros for qemu run/rerun targets QEMU_SYSTEM_RUN = qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(KERNEL_IMAGE)" -serial stdio $(QEMU_ARGS) +TIMEOUT_CMD = t=$(QEMU_TIMEOUT); past=0; \ + bios_timeout=$$(expr $$t - 7); kernel_timeout=$$(expr $$t - 5); init_timeout=$$(expr $$t - 3); test_timeout=$$(expr $$t - 1); \ + err=""; bios=0; kernel=0; init=0; test=0; poweredoff=0; panic=0; \ + echo "Running $(KERNEL_IMAGE) on qemu-system-$(QEMU_ARCH)"; \ + while [ $$t -gt 0 ]; do \ + sleep 2; t=$$(expr $$t - 2); past=$$(expr $$past + 2); \ + if [ $$bios -eq 0 ] && grep -E "Linux version|Kernel command line|printk: console" "$(RUN_OUT)"; then bios=1; fi; \ + if [ $$bios -eq 1 -a $$kernel -eq 0 ] && grep -E "Run .* as init process" "$(RUN_OUT)"; then kernel=1; fi; \ + if [ $$kernel -eq 1 -a $$init -eq 0 ] && grep -E "Running test" "$(RUN_OUT)"; then init=1; fi; \ + if [ $$init -eq 1 -a $$test -eq 0 ] && grep -E "Leaving init with final status|Exiting with status" "$(RUN_OUT)"; then test=1; fi; \ + if [ $$init -eq 1 ] && grep -E "Kernel panic - not syncing: Attempted to kill init" "$(RUN_OUT)"; then err="test"; sleep 1; break; fi; \ + if [ $$test -eq 1 ] && grep -E "reboot: System halted|reboot: Power down" "$(RUN_OUT)"; then poweredoff=1; sleep 1; break; fi; \ + if [ $$past -gt $$bios_timeout -a $$bios -eq 0 ]; then err="bios"; break; fi; \ + if [ $$past -gt $$kernel_timeout -a $$kernel -eq 0 ]; then err="kernel"; break; fi; \ + if [ $$past -gt $$init_timeout -a $$init -eq 0 ]; then err="init"; break; fi; \ + if [ $$past -gt $$test_timeout -a $$test -eq 0 ]; then err="test"; break; fi; \ + done; \ + if [ -z "$$err" -a $$poweredoff -eq 0 -a $$panic -eq 0 ]; then err="qemu-system-$(QEMU_ARCH)"; fi; \ + if [ -n "$$err" ]; then echo "$$err may timeout, test failed"; tail -10 $(RUN_OUT); else echo "powered off, test finish"; fi; \ + pkill -15 qemu-system-$(QEMU_ARCH) || true + +TIMEOUT_QEMU_RUN = ($(QEMU_SYSTEM_RUN) > "$(RUN_OUT)" &); $(TIMEOUT_CMD) + # run the tests after building the kernel PHONY += $(KERNEL_IMAGE) $(KERNEL_IMAGE): kernel run: $(KERNEL_IMAGE) - $(Q)$(QEMU_SYSTEM_RUN) > "$(RUN_OUT)" + $(Q)$(TIMEOUT_QEMU_RUN) $(Q)$(REPORT) "$(RUN_OUT)" # re-run the tests from an existing kernel rerun: - $(Q)$(QEMU_SYSTEM_RUN) > "$(RUN_OUT)" + $(Q)$(TIMEOUT_QEMU_RUN) $(Q)$(REPORT) "$(RUN_OUT)" # report with existing test log From patchwork Thu Jul 27 20:31:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127169 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp7490vqg; Thu, 27 Jul 2023 13:55:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZuAsQbgERv8VPAztXoIE1dKYS92jO7eRut49BeJ6ipLSjUGyeVXwKBqX43gRUPyQKVAga X-Received: by 2002:a05:6a00:2316:b0:686:2526:ee70 with SMTP id h22-20020a056a00231600b006862526ee70mr327593pfh.14.1690491318005; Thu, 27 Jul 2023 13:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690491317; cv=none; d=google.com; s=arc-20160816; b=USY4CrO6YJ3TmN5LuNKr/hjYMMZsmpciIyKmIHQdnIoY/3CpPrvlI1TuKtVhCGrOy+ PUibzIQpocTrETCsHWmm1ahWKAZ80lcAYea69Fx3hsdsmjEUeBxdr4+pun1cM/Tu2yWg hSR3Ep+/9dhcrMHmluqkFsCcJW/11gxUkuXwmQN+ZnEQ89zT6KzNEf82BPjCRk26eZZn aU8HX7vuj76gLs6/khaAD9bt3k8HeZC4L61Bd4qP8tVLU2C5T+/tpBsmTYfUe5DHMelF PzSwuaWBb+VLizqkzc8yi1eVOxseAm3tInXHD3DJ9S0E/wWKbf54fkNvsCtNr8ii8ztV /3GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=O5MBCcF/4xhCcJX+EjA7RY8ag7f9yL+b4HkTotF9xQU=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=Ph6GyHtCsXsm7+qYHVxA8eUbRY+Q57oWWmszf956AAO6fBEb76FHMB860MjA4hV/kn 6Oq9zxKHJhnIzK3KTzeSCNvBmo1KryxlqbS6vZVy706uXk5IKH+mpxC1dHgDlmzSscJ2 w3vcqe48LxYm7XWUuBcFxhDo+zPGYTHcgnpX6VdsOlLKgNU7Fnm2nkXjEEaoKb7olcCT O+VTKwrLQucEwYm/JU9AoR0Y3Kspk/KxgMwVeVXmuxDrpLLcqi09aanXa6FwSb2JOt8F HDo5MtwqW2RZ4pnvapdsGuWmBGF00WLxN863tMCW75iq2VITEuh6sYp+s8aBiDTCJaRB lrWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds5-20020a056a004ac500b006744cbb3ebesi1837171pfb.127.2023.07.27.13.55.05; Thu, 27 Jul 2023 13:55:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230342AbjG0UcL (ORCPT + 99 others); Thu, 27 Jul 2023 16:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231398AbjG0UcI (ORCPT ); Thu, 27 Jul 2023 16:32:08 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D05E30DB; Thu, 27 Jul 2023 13:31:50 -0700 (PDT) X-QQ-mid: bizesmtp71t1690489900tiuhvymd Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:31:39 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: 3M0okmaRx3iio5UHKEhK5b2ClrY+IfoQsoiyLkp16KXoPNZd6NKJ6Hq2TkPOp lxuEVdu0iqSsDofWqZLbsQNWgPuh4dTi3eZroNw+JgJBygfCJFjpuRtgX7H8WMWgkbAg4Lx HpQCjdORRam1SuzECvY3se07e0xnOANa0+i63yBaLR2iLK1CL3yVwmcFjZ0ZptN7WavMAhs 1X1RMFp4Mcb7h8SZhMJ966izSIJvKs6VM+7Rz+6TqgzWp+/SYLMiOQ2LhWCqRvqE0Dyva9V 8Df/r12xiCcEP4zb1cAwJ/yl39Tid5XJd1HShHLXUqPMkt7sEpx1X+eF8Rhcs7sGJ55iMFe iFUzR0cIPJ1QNBsh8JfDO5wzHsY2Eha/SLBOaLqj3UT0zUcKgLDQppuzwPvIQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 8403613974557991608 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 09/12] selftests/nolibc: customize QEMU_TIMEOUT for ppc64/ppc64le Date: Fri, 28 Jul 2023 04:31:39 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772608624542588672 X-GMAIL-MSGID: 1772608624542588672 Both ppc64 and ppc64le use slow bios in some qemu versions, let's increase the timeout to make sure the running qemu would not be killed before the test finish. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 9a57de3b283c..ad2538ec5eb0 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -106,6 +106,8 @@ QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=N QEMU_ARGS = $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_EXTRA) # QEMU_TIMEOUT: some architectures can not poweroff normally, especially for tinyconfig +QEMU_TIMEOUT_ppc64 = 15 +QEMU_TIMEOUT_ppc64le = 25 QEMU_TIMEOUT = $(or $(QEMU_TIMEOUT_$(XARCH)),10) # OUTPUT is only set when run from the main makefile, otherwise From patchwork Thu Jul 27 20:32:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127165 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:d09a:b0:134:c3fc:3153 with SMTP id jc26csp189967rwb; Thu, 27 Jul 2023 13:49:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlEyzzTY81RbLdYap2KJHnslX255YIXFom7IJqg1VdjuoDwvQyXnGDyu1lGcAV7xbhNx9oGf X-Received: by 2002:a17:90a:d917:b0:268:7be6:29a5 with SMTP id c23-20020a17090ad91700b002687be629a5mr391916pjv.9.1690490960910; Thu, 27 Jul 2023 13:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690490960; cv=none; d=google.com; s=arc-20160816; b=01bDDUzaylt415uPzbN7MPvdeqs6li1CD+5IqVysHWwnE8EGcOFukQTGzpAUyt7gMr dBwAfV31ho3uckwOO7PGBxNPRJnVTQMqDdo7Z4ERhVda92pQGEOcblo5rPEIDPzDMhDq 2k6zbZXbK4HF6dlxmVPNE04uYGnfF2FtQyrqxTjR1yLp1wxNzx9IBQFHmJRINkrN/WBu +lcycV79nvU5Q1WNEsgMjv6+i9lD9knJFCqP98eadu/SswBxu7Af9dNNH7nhB7mHVQTG loPUS2gjxxzSFNKZ4GnKv56KsRs4k3d2XJnd+eF6nJtTNpE1lWTBn+Nm3GM5l+QUGoep jqqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=3RmO2eXPsCqkkVllhugQ+ruu+RB6qKHY3w9YE18BtYo=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=yhbh2GdefXByyfla983ANx5Rs0/wUbdExRaLkLqMVu5ebPJKT/VU7HIHyyyuMw1IHk AmOkCjQSFFgrW48slG7icAdWOHe7cryTfApppik5mxNhP9WGeneTDmqb5rgI44UojgrY Nvv3tZ/sv/ZqE4C9KJzSARhrijSfvjZ3rTMZEq4Q1Djo/wdjVNvOdJMsepgDIJ/XvTgF csyI+Vb2BD+VAcDlzcoyuoqXsJNhkujUgjdSC5LFj3WUC1IP26YVMZipVIKo3SW1DMjF 4wQ6RlBQbHe7Bs6chkYZ/nJXxtQyJy0IXdxtVfLAw4laUt5qie0aHjWv/9doIhjovw3v /xuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a17090a348100b00267ec897aa7si1838937pjb.104.2023.07.27.13.49.08; Thu, 27 Jul 2023 13:49:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbjG0UdT (ORCPT + 99 others); Thu, 27 Jul 2023 16:33:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231959AbjG0Uc6 (ORCPT ); Thu, 27 Jul 2023 16:32:58 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45940F5; Thu, 27 Jul 2023 13:32:57 -0700 (PDT) X-QQ-mid: bizesmtp89t1690489968tjf0ydyx Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:32:46 +0800 (CST) X-QQ-SSF: 01200000002000D0X000B00A0000000 X-QQ-FEAT: +ynUkgUhZJkRxmTCWl75yKqo2fa1gLrTMSfYGM0V6uWTshSZ0cgdrv7cH/mZn dmX2sbf39Iyx1LX2kZa+vgxT8UOo4T5hxuT7dgpiJ6+3y3K8zuQZcX3CaCxWmcYdHJ9+ScP GtJIUU3bQdI6s8wWEomWlMCiLYKRgcLvtXD2NlwTiAdCGYpeChxDvfT3AIwmNa6xpnjdykf F476R5yc11Cn8Ive9Q1+bHgrFnZOLe3e+4hNszy2MRvJMbavTSgYGQ1JdwFqfWcDQg0qmSe yA9ajOz5duRz1dhmUpw0ZewPx1EkoNjQ0VE0Jla10GreyzUpKEo4XLv7AHBjcaVVYGxDTFp zmSCihnPDQlMRJptYUFdN3udt3VV2nKnCwfQYajztRIpHI0bFhWt7qZn1o9bw== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 7408932279377289764 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 10/12] selftests/nolibc: tinyconfig: add extra common options Date: Fri, 28 Jul 2023 04:32:46 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772608249497031740 X-GMAIL-MSGID: 1772608249497031740 The tinyconfig target from top-level Makefile has already enabled some common options, but they are not enough to enable boot and print. $ find kernel/ arch/*/ -name "tiny*.config" kernel/configs/tiny-base.config kernel/configs/tiny.config arch/x86/configs/tiny.config To enable qemu boot and console print, additional kernel config options are required, include the common parts and the architecture specific parts. Here adds minimal extra common parts for all architectures: * for initrd: CONFIG_BLK_DEV_INITRD * for init executable: CONFIG_BINFMT_ELF * for test result print: CONFIG_PRINTK, CONFIG_TTY Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/configs/common.config | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tools/testing/selftests/nolibc/configs/common.config diff --git a/tools/testing/selftests/nolibc/configs/common.config b/tools/testing/selftests/nolibc/configs/common.config new file mode 100644 index 000000000000..3957f812faac --- /dev/null +++ b/tools/testing/selftests/nolibc/configs/common.config @@ -0,0 +1,4 @@ +CONFIG_BLK_DEV_INITRD=y +CONFIG_BINFMT_ELF=y +CONFIG_PRINTK=y +CONFIG_TTY=y From patchwork Thu Jul 27 20:33:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127186 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp15879vqg; Thu, 27 Jul 2023 14:15:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlGoJEALXLynzfLJeao/ZCQ0ZamXu/dRPK2UWCNYSi1pYYRK8Y6FVRwUFj5DjATL3IDsDGK3 X-Received: by 2002:a05:6a00:2288:b0:686:24e1:d12e with SMTP id f8-20020a056a00228800b0068624e1d12emr428721pfe.30.1690492519705; Thu, 27 Jul 2023 14:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690492519; cv=none; d=google.com; s=arc-20160816; b=i0As3HnFDxT1Y5ytAvztxhifGo3N20Lvrp9rKJLkMrJNgsYF5WFf5lBTF7gkjTh5iQ 9rPhMzaFhKacgSJ8pSUMCfffZ4wzx5gNhF7kNyHvrwDcmq9zaqBV3J38F+mdgz69farm WtmcvxPcGjfV2Cc2NF9088TkTI1YY7GdbMLCqKvnLBiLdc6WfurxZYwGEocBIS0bPIbs 5ReEBeVPjsKk0BLWfrTueUCLAFPYr6hYPz4tTMTBz7r358P7O/Cq2Ik44wGF4oNMVd3e 65lpa5A1E/4uKEiWtn/0758i+Ms+VZGAiw/U+JUFjG51dpSwCXem5u7uQKchujpB0OMP lSew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=v4dkwbSiJAIBgKH6pDfHOS72aisZiSDq61tURQG/a0U=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=l1YJwWKsqEeptkgW56d4cl9LnlExb+xMlgwKXUBqp/gj2asZCXW1NkyOs9KXpzk8Zu 704Bx6pnKK0Vs5Eicgd7kXaGaieYoe1CGCgMAk+kxi8A51GGjB1C/dxSEOXaZ9zOkaKI Dwn80NTD3Hu4yXHdh95SsxyCkE8aihLeVmQO/uj/S8WkfkeBbCrOirxJcwnkebDa4qy8 U/6WeZo9rGIr+e2LtsE8AFMJ2QAO8/FtwQ06iJKkvdBTfQ1Pdds7VDOqcpWa500S8snB lMcTBUYjf/Jv3DSvaBzrLyCFzhaSmVx0cAWDjAR06qXOKML7AzooTnw6L2rPqF5yzV0l KIFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x32-20020a056a0018a000b006665f0400a7si1891395pfh.197.2023.07.27.14.15.04; Thu, 27 Jul 2023 14:15:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbjG0Ue0 (ORCPT + 99 others); Thu, 27 Jul 2023 16:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbjG0UeY (ORCPT ); Thu, 27 Jul 2023 16:34:24 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0B730EB; Thu, 27 Jul 2023 13:34:04 -0700 (PDT) X-QQ-mid: bizesmtp81t1690490035tu076myn Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:33:54 +0800 (CST) X-QQ-SSF: 01200000002000D0X000B00A0000000 X-QQ-FEAT: Y6Kc/cQg3lYdDDFJ90mtjrutfwesBX2jEXConbTZEba2sKx27B/oxMiaMAba8 hwIK0o+c2wffDHiHcQbDmpwB0Qe+iEUiXS2aUmAoTZ1ib/u8Sk7n+NB1Fqkwei5rt8DBMso iW4QXw1X8ZnkHvRR6B92r5ZAnW8XaDKAjDhUEgbAYsjKMFUDpOi782Q5XaU2P+dOcLMuoJQ Md4aoZU8FdsNorryyB+6OuScHeZ3G3x+A/jXSFpqSkGT1FcVD11ifzf47aNta6MJytc3G/d 42KABhdRngyeOs++ddJWhwi2MruJcGkZNO8+eoF6S15ywZB0GYaTvLrbMOr/Ae79OM1xrOP kYVjm5o7KLAZd6L2iEWwbpbF5qvqOdn/2euao0AsIel3rA4fgywiqU8iwD36MiCFw+KY+yK X-QQ-GoodBg: 0 X-BIZMAIL-ID: 10885213077665245786 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 11/12] selftests/nolibc: tinyconfig: add support for 32/64-bit powerpc Date: Fri, 28 Jul 2023 04:33:53 +0800 Message-Id: <983843582e52e83fba79ad45cea6c79e1f62ec6c.1690489039.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772609884411411840 X-GMAIL-MSGID: 1772609884411411840 This adds extra config options for ppc, ppc64le and ppc64, now, it is able to use tinyconfig as the minimal config target to speed up the run target of powerpc: $ for arch in ppc ppc64 ppc64le; do \ mkdir -p $PWD/kernel-$arch; \ make defconfig run DEFCONFIG=tinyconfig ARCH=$arch O=$PWD/kernel-$arch | grep status ; \ done rerun with architecture specific run.out: $ for arch in ppc ppc64 ppc64le; do \ mkdir -p $PWD/kernel-$arch; \ make rerun ARCH=$arch O=$PWD/kernel-$arch RUN_OUT=$PWD/run.$arch.out | grep status ; \ done report with existing test log: $ for arch in powerpc powerpc64 powerpc64le; do \ make report RUN_OUT=$PWD/run.$arch.out | grep status ; \ done Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/configs/ppc.config | 3 +++ tools/testing/selftests/nolibc/configs/ppc64.config | 3 +++ tools/testing/selftests/nolibc/configs/ppc64le.config | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 tools/testing/selftests/nolibc/configs/ppc64.config create mode 100644 tools/testing/selftests/nolibc/configs/ppc64le.config diff --git a/tools/testing/selftests/nolibc/configs/ppc.config b/tools/testing/selftests/nolibc/configs/ppc.config index b1975f8253f7..29123cee14c4 100644 --- a/tools/testing/selftests/nolibc/configs/ppc.config +++ b/tools/testing/selftests/nolibc/configs/ppc.config @@ -1,3 +1,6 @@ +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_PPC_PMAC=y +CONFIG_PPC_OF_BOOT_TRAMPOLINE=y CONFIG_SERIAL_PMACZILOG=y CONFIG_SERIAL_PMACZILOG_TTYS=y CONFIG_SERIAL_PMACZILOG_CONSOLE=y diff --git a/tools/testing/selftests/nolibc/configs/ppc64.config b/tools/testing/selftests/nolibc/configs/ppc64.config new file mode 100644 index 000000000000..4e17f0cdb99f --- /dev/null +++ b/tools/testing/selftests/nolibc/configs/ppc64.config @@ -0,0 +1,3 @@ +CONFIG_PPC64=y +CONFIG_PPC_POWERNV=y +CONFIG_HVC_OPAL=y diff --git a/tools/testing/selftests/nolibc/configs/ppc64le.config b/tools/testing/selftests/nolibc/configs/ppc64le.config new file mode 100644 index 000000000000..713b227f506f --- /dev/null +++ b/tools/testing/selftests/nolibc/configs/ppc64le.config @@ -0,0 +1,4 @@ +CONFIG_PPC64=y +CONFIG_PPC_POWERNV=y +CONFIG_HVC_OPAL=y +CONFIG_CPU_LITTLE_ENDIAN=y From patchwork Thu Jul 27 20:35:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 127176 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp10160vqg; Thu, 27 Jul 2023 14:02:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFIJoSCLEkqMEFli2PjiR4Bn2IS5rbVlddj3QpRJJ9Xt+1Oj8kCU5Cf3Mwk8igZUJs5VbwK X-Received: by 2002:ac2:530a:0:b0:4fd:fe8f:4108 with SMTP id c10-20020ac2530a000000b004fdfe8f4108mr200179lfh.62.1690491731815; Thu, 27 Jul 2023 14:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690491731; cv=none; d=google.com; s=arc-20160816; b=h8c0CHINsv2ebIfwB6CEmxOhZErkJsAzFojfFvbKCExEAvCk+cJHA3P6qxG0hMv7aj 8vgXAUUUeMTUaRGhqibfswC/6dH9abh8D90rb5xGCP7LxnExZAQcKq1oq3gBwiuY81MG FGXGlcE7+4kOQoHD/9pvoDXkFaQbsXx7vYpGHqTml5Uq1Nz+yKeYswo77xAkbRpegatY +0rWM//gE8nPZszoxf/GQxa/grs/lJfPTAzDL+KtDkn23ulHUbQYYMum++tdyyPY4KV0 N5a9h4gZOhx5RT4wDdZ2zeBeo05vw+NSg5Yg6FuiYJHUyGWc/mOzrwFAv6t9Iq/iGY9+ 19eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=yDL/YbEJX/w2NlXmB+1QCZcsc3XH9BdQsOOLqmHin5A=; fh=CR7OSt3Y+a8PS+dgzZNHcKmuduX0vKjLX+CD3ki537g=; b=OXCLIISW/B6r40IbwW101UnA2oEqTPEn2BY4TAL+NvsixXsWb/rPLsznCEBxsxlEaw J+pdw8Zux9ync1g+BtuuIQ+NNaSRTQlszTmDfcUCo56q3zHm9d6DK39Qq2uWvrlYng5Z 0EZaEV70IhXfJ1+nsp0F+XDRcE5one24KJK4uSJ/BZXb4O8mueyHf8ShDXcLALlnlink 5mWtUJC/y2U21h0pEb6UnkwtEhbXQ0ERENRwjxYzzbyfe9BDJI8NNR3WOeCDQVjQB2wA ydEbLpbDyl6SH+ZqyukAdlENkblqbSxkwbh2ZjBn85zGbNkkpjJl5l3FqpXZI63Ztcus sThA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c11-20020aa7d60b000000b0052229b7a961si1510197edr.476.2023.07.27.14.01.46; Thu, 27 Jul 2023 14:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbjG0UfR (ORCPT + 99 others); Thu, 27 Jul 2023 16:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbjG0UfP (ORCPT ); Thu, 27 Jul 2023 16:35:15 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4828271C; Thu, 27 Jul 2023 13:35:13 -0700 (PDT) X-QQ-mid: bizesmtp65t1690490104tdo0lyfq Received: from linux-lab-host.localdomain ( [61.141.78.189]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 28 Jul 2023 04:35:02 +0800 (CST) X-QQ-SSF: 01200000002000D0X000B00A0000000 X-QQ-FEAT: rZJGTgY0+YOFURgI4rO4FCPYfZtEtfnMGBKFe0DXq/9mV7CVBMsYHOMR4+JVr IOjcZ4pyh73O5L5n/JDvdzIMMCtbuhFCCO44m0pvqeXuESuDcN2xUKASBx63aVhk3t7tc54 K5DJI5ifluK37jWOc54qO9uY6B3j7f6msEJ8K4yVhVodJOILbBFPFeriiptpNxGRDN0SVzJ Q6zx9zbVOo6TBjyF0plarqxyqxegL9TDqmSSy4/oP38NYrS2lTTjvH79Hzqz5m4OQVs6vjL vsaaZv8k0s2lQFP7yYJ4HG9hvlPonlQFkvnbhJJHdbZbXZYswjhieFAky/22sa+CtrvtdqC igOmTDSJsdVqG0HL6MOGxfRS1rUxlxkwcxbP5F0GyD0dy1RYaF83ud/JsEbRQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 17780552390268563941 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 12/12] selftests/nolibc: speed up some targets with multiple jobs Date: Fri, 28 Jul 2023 04:35:01 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772609058173687669 X-GMAIL-MSGID: 1772609058173687669 The sysroot install and kernel build targets are time cost, let's use -j to parallelize them with multiple jobs. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index ad2538ec5eb0..1b45c22f9a94 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -171,7 +171,7 @@ PHONY = sysroot/$(ARCH)/include sysroot/$(ARCH)/include: $(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot $(QUIET_MKDIR)mkdir -p sysroot - $(Q)$(MAKE) -C ../../../include/nolibc ARCH=$(ARCH) OUTPUT=$(CURDIR)/sysroot/ headers_standalone + $(Q)$(MAKE) -j$$(nproc) -C ../../../include/nolibc ARCH=$(ARCH) OUTPUT=$(CURDIR)/sysroot/ headers_standalone $(Q)mv sysroot/sysroot sysroot/$(ARCH) ifneq ($(NOLIBC_SYSROOT),0) @@ -211,7 +211,7 @@ initramfs: nolibc-test $(Q)cp nolibc-test initramfs/init # common macros for kernel targets -MAKE_KERNEL = $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) +MAKE_KERNEL = $(MAKE) -j$$(nproc) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) KERNEL_CONFIG = $(objtree)/.config KERNEL_IMAGE = $(objtree)/$(IMAGE)