From patchwork Wed Jul 19 13:17:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 704502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 806F0EB64DA for ; Wed, 19 Jul 2023 13:18:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230463AbjGSNSU (ORCPT ); Wed, 19 Jul 2023 09:18:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbjGSNSR (ORCPT ); Wed, 19 Jul 2023 09:18:17 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AC25FD; Wed, 19 Jul 2023 06:18:15 -0700 (PDT) X-QQ-mid: bizesmtp68t1689772685tf75yw6o Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:18:03 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: 3M0okmaRx3grmu9MUHFbrrVNG0WzcH6N1ULMpWmAsKbuISmAuO5FAvE/jYi3P g7qSYNWjT9UXfSwx9OmnfYAddtleSX7TeZNg2ORN61CD9vys8r+n1tdunweA/xhXZVtMuvp U9DxcXQRsoxsGxKnUWmgXrvFuivUcMIc0pGXuis/bMfH3XPgmAjDUI+ZfdbTdY5SgFDxxjw ik3x7NFvu30HEZJepW78xk3Z2zb6o4f63p2olvK0VtT4/fUAHmnuYGq7YFJGiBpIt+my94X m36EH+4uzoHfnkOufpeYEKqEyj55Yhi7F6k1SAhZdKwbbbCyWcwqR7dm9PrbgolksZDjNca M0zp1eRc0qukXPHuAQCNJq2rz5CtJe0AgXa7GMrgb+wEPLZhQ0LXI0wBKnaiQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 5670957446620679484 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 01/14] selftests/nolibc: allow report with existing test log Date: Wed, 19 Jul 2023 21:17:59 +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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 ab17e0d8b7e2..0cd17de2062c 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -206,6 +206,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 Wed Jul 19 13:19: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: 704792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC700EB64DA for ; Wed, 19 Jul 2023 13:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229471AbjGSNTX (ORCPT ); Wed, 19 Jul 2023 09:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbjGSNTW (ORCPT ); Wed, 19 Jul 2023 09:19:22 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F30F9125; Wed, 19 Jul 2023 06:19:20 -0700 (PDT) X-QQ-mid: bizesmtp70t1689772752tdo5hf5m Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:19:11 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: +ynUkgUhZJmS7aWA1MF5mWbEkqg6YFGMNEdccEOgkkP+0XR/32r431zhxHhIH Hm6hMRh0/leap3zvRmOxuJJLlaB5qN5xUbcd9P1qvuDZye3nmnSjCYhUFFJxGkB5XTDBjY+ AR2fbkznlPJNook9BF72hihBqGCX+HRhcvewGCyV+WbkJXG3RlA1iK5Jzt7Y/WvDKeF6S98 ihfAB+A9ljPFt9SpJy4A4nCM9TFUkxMXV3EQ9gva1fz3FbIbyyB1GuuxsC6p59aZMHL1obO KkMEwmqgmhCANuIvgmAj4HLglhTh5JggccgjebfxeVNscCSLLwKgTz5XIhnV2TChxjwab8G oVTgn9VvMG3zZxxx4+EMFD/QNgAFGn+04JxudtBJaElu9wHVBs5sdwkt7EdYoHCv5cSjsaz X-QQ-GoodBg: 0 X-BIZMAIL-ID: 16744309574529494032 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 02/14] selftests/nolibc: add macros to enhance maintainability Date: Wed, 19 Jul 2023 21:19:10 +0800 Message-Id: <0415392c9c2b0a7249563abd79599a475019b508.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 share the same logging related settings, let's add common variables RUN_OUT, LOG_OUT and REPORT_RUN_OUT for them. The qemu run/rerun targets share the same qemu system run command, add QEMU_SYSTEM_RUN for them. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 41 ++++++++++++++++--------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 0cd17de2062c..8c531518bb9f 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -166,45 +166,58 @@ endif libc-test: nolibc-test.c $(QUIET_CC)$(CC) -o $@ $< +# common macros for logging +RUN_OUT = $(CURDIR)/run.out +LOG_OUT = > "$(RUN_OUT)" +REPORT_RUN_OUT = $(REPORT) "$(RUN_OUT)" + # local libc-test run-libc-test: libc-test - $(Q)./libc-test > "$(CURDIR)/run.out" || : - $(Q)$(REPORT) $(CURDIR)/run.out + $(Q)./libc-test $(LOG_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 $(LOG_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 $(LOG_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)$(MAKE_KERNEL) mrproper $(DEFCONFIG) prepare extconfig: - $(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)$(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) $(LOG_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) $(LOG_OUT) + $(Q)$(REPORT_RUN_OUT) # report with existing test log report: From patchwork Wed Jul 19 13:20: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: 704501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D10B2EB64DA for ; Wed, 19 Jul 2023 13:20:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229622AbjGSNUb (ORCPT ); Wed, 19 Jul 2023 09:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGSNUb (ORCPT ); Wed, 19 Jul 2023 09:20:31 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBA8A113; Wed, 19 Jul 2023 06:20:29 -0700 (PDT) X-QQ-mid: bizesmtp85t1689772819twb1jfej Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:20:17 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: D2GZf6M6C/hj3mYQLM88nlD2/Bu6nnA6SGYdUSehcdKNVIGkXjN0KKlH1XkyC rw0zS+R2oehzieMoKnE3XC/UQkcpuzTLEUl+IxDag2sW11hJq2NSTs7tUnFs+JzstgFTm5z unpbSl/Fy6JIRLdNKwSRjWWZcPoHTLevni6NilJdqG0HPbQYUziCJIwMOZTF/BalkMtXf1Z rg2TWC0UCXFlS4Mm/5bPdxy2C9eqJxIKdO4G9XibDMP1pDpjj4nHRMxaErBf7q3RL9LArh8 v6Pm5gNrD4QtMj53G8dK9AE0fovcIj8My5M5mpCmpmtQey5kV0H9GckANp7Kxuf+NHHYnLm GK2vkuxrrObADSOGo6OgsZqq/KTPwc4rCfUiky0LLCakI/9hbyVhwEscb0Jgg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14450965798290048757 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 03/14] selftests/nolibc: print running log to screen Date: Wed, 19 Jul 2023 21:20:17 +0800 Message-Id: <1373113bdaf2d4812c3d712684bd0019f992a032.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When poweroff fails, qemu-system will hang there without any output. It is very hard to debug in such case, let's print the running log to the screen to allow users to learn what is happening at the first glance, without editing the Makefile manually every time. To get a clean output, the 'grep status' command can be used. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 8c531518bb9f..f1c8e4a0f1b2 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -168,7 +168,7 @@ libc-test: nolibc-test.c # common macros for logging RUN_OUT = $(CURDIR)/run.out -LOG_OUT = > "$(RUN_OUT)" +LOG_OUT = | tee "$(RUN_OUT)" REPORT_RUN_OUT = $(REPORT) "$(RUN_OUT)" # local libc-test From patchwork Wed Jul 19 13:21: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: 704791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C3CDEB64DA for ; Wed, 19 Jul 2023 13:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbjGSNVo (ORCPT ); Wed, 19 Jul 2023 09:21:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGSNVo (ORCPT ); Wed, 19 Jul 2023 09:21:44 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B973C10FE; Wed, 19 Jul 2023 06:21:40 -0700 (PDT) X-QQ-mid: bizesmtp82t1689772890ty9q7xay Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:21:29 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: r7EP/KuzAv8EqZ+SJffUfZBdMtI1nkzgD6ro01hnSaF51Og9hAgW29XL4W3Al ppLr/GYJVVlMZk7h+6fi7kR8pA/JLEFOAyDlqpuOUHwDRhBXzrLNE64VeS3PKfvvpI6CXeJ 0kydvZH/SrharXA9Is+1UoB0kDNPtcU9IZ36DHV56Yl9QQIO7jLRP7/+kG1g3HZyU9DA37d CFf4o578Az9IohYXlkq6VPqkoq9dAub/t2ecSak3ZtRBT4Vqy08XgRCMzMnlCMof+ZnZVZ5 nWrXfEMPHmL2NoZ2fNT8daNO6A+WpSt1HgsGrOzQ58k0rMFM4HjGzEbYckfHOYgf/7K5v7S 1ucwJoO6g8uX3y3oLmf+/SdTsKnS8NsAtBzZxKN4hA2E9qMwMr53ku+fazOTMo1POppaGTZ X-QQ-GoodBg: 0 X-BIZMAIL-ID: 12083779158113029408 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 04/14] selftests/nolibc: fix up O= option support Date: Wed, 19 Jul 2023 21:21:24 +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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 f1c8e4a0f1b2..058e7be070ea 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) @@ -193,14 +196,14 @@ 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 extconfig: - $(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 Wed Jul 19 13:22:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 704500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40E8FEB64DA for ; Wed, 19 Jul 2023 13:22:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbjGSNWz (ORCPT ); Wed, 19 Jul 2023 09:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230509AbjGSNWy (ORCPT ); Wed, 19 Jul 2023 09:22:54 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F3C4113; Wed, 19 Jul 2023 06:22:52 -0700 (PDT) X-QQ-mid: bizesmtp82t1689772962tgim8kcd Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:22:41 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: +bXiSo2NuBcL7jnLryDuQMhX+oFM/svSg3z6REjIYNvM0REi9CZiqEZnjWRCL ssb+wsQjZ8s935FBqNK3tojAPMVXvl8aV9UwAK4EfLNhW/r5ms/tCdMPpdIOt+EflVmdYDz bGXR5iCBo5Msz82inD3wj21q5qlY68UzWajtjYfmI/qROoSLF/gr8+RZjy0dVjexSpSJAWe ZMJFwMm3toAP1U5OAgMvedAY1thea5XkWrW/IQqVygK0NmrlAtUEjTSFS7v7Asp9KE6SapD ssDVy24csF5bypQdq1aRUxLKlNl2YDCxZxGTf7JBgTaIAPsl6Ys5c8tmCsUlV0nTxpiLOX5 sT+xKsrQRu+BO6ZbNbJYCo79gZik5C5S+DdEarQ8QOA74L72Jrnms/QqWlLrSNmZW5/ZfEV X-QQ-GoodBg: 0 X-BIZMAIL-ID: 1272607350294726886 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 05/14] selftests/nolibc: add menuconfig for development Date: Wed, 19 Jul 2023 21:22:37 +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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The default DEFCONFIG_ may not always work for all architectures, let's allow users to tune some kernel config options with 'menuconfig'. This is important when porting nolibc to a new architecture, it also allows to speed up nolibc 'run' target testing via manually disabling tons of unnecessary kernel config options. 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 058e7be070ea..06954b4b3885 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -202,6 +202,9 @@ KERNEL_IMAGE = $(objtree)/$(IMAGE) defconfig: $(Q)$(MAKE_KERNEL) mrproper $(DEFCONFIG) prepare +menuconfig: + $(Q)$(MAKE_KERNEL) menuconfig + extconfig: $(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 From patchwork Wed Jul 19 13:23:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 704790 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D976CC001B0 for ; Wed, 19 Jul 2023 13:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230518AbjGSNYB (ORCPT ); Wed, 19 Jul 2023 09:24:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjGSNYB (ORCPT ); Wed, 19 Jul 2023 09:24:01 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 462CEFD; Wed, 19 Jul 2023 06:23:59 -0700 (PDT) X-QQ-mid: bizesmtp85t1689773030t5e87exz Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:23:49 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: 3M0okmaRx3hNEMaNV2ioaObF5OMlW4ww9cct06aqxtedtRCfN70YUmF3a484b 9Qjbfp6aj9FY1AKa7K9kAHuWursDDOWcZoJgbNNRrs/V+KNyYZaDEGlwRoH/ib0d5FT6ZOL cveUkLm+0DaUPwrlGCrGJhHP+w2meeI96aA+kuHnMb3ZdIgHe7jV0WId4rG1T4LJdAPUxkV HIcERzcKwwEOUmmyjtbUBz39qzmo5rl1HFT/LmUmfP7joFD6tBfEtZygyydZezi8wic9O3z lMHAG1sCFWCHMIrzfZgha001OwwRZhf2AaMTNdQNuWzONlCCSr9OVyoX1IiGs880pf9TDpK D6ZsgwuXgQLzee68YjD58Iig0WHxM2QIUrNU0Q7tDUQeAh/hBuKj+XHASpPfw== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 37435219588245657 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 06/14] selftests/nolibc: add mrproper for development Date: Wed, 19 Jul 2023 21:23:48 +0800 Message-Id: <30b7328645ad7baec6e63daaf069dd97d5456269.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When want to start a new building with O= option, the old generated files in the source code tree must be mrproper-ed, adding mrproper target here to avoid switch to the source code tree manually. 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 06954b4b3885..9d9902b54e5e 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -199,6 +199,9 @@ MAKE_KERNEL = $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROS KERNEL_CONFIG = $(objtree)/.config KERNEL_IMAGE = $(objtree)/$(IMAGE) +mrproper: + $(Q)$(MAKE_KERNEL) mrproper + defconfig: $(Q)$(MAKE_KERNEL) mrproper $(DEFCONFIG) prepare From patchwork Wed Jul 19 13:24:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 704499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF044C001DE for ; Wed, 19 Jul 2023 13:25:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231189AbjGSNZI (ORCPT ); Wed, 19 Jul 2023 09:25:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjGSNZH (ORCPT ); Wed, 19 Jul 2023 09:25:07 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD83BFD; Wed, 19 Jul 2023 06:25:05 -0700 (PDT) X-QQ-mid: bizesmtp80t1689773096tvcme5mq Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:24:55 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: HzdOSj0Bmys3/fOoqbEWdmxqkRROHEaQlEr+veWl6qr7J4qAL4t6mLHXQg1Ae oJ1k9dIndDeyN6LIRorFFpXBgVRAoP/Ui+ew0uZZJnIffORC7NlmPt5jJTyXQThDo2gDs0E o046oUM4s5eX2dJRXtSBVY62qAJYmoHZ5T9ySwt+qTYQHFyk7X4lJE6wwdvosb/orSpuTip tBGneNnha00pwUhzibN40qIlMYGfOcwSO5THfqdn9dRkZaYUVIg2MqmfDJjH45RNFbNL1n4 5q3a4pg/WmGF8aqkdlpJNgBa0iTMEpcVgRmXsXCR2jIeIT8sGHS1o2glMnR9M20tQDwi8HY n8vlR7Z1rYuxE97wp8KcHmo6Y2GEqegrELfozgtqD2YjCldim0= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 7211787249313186061 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 07/14] selftests/nolibc: defconfig: remove mrproper target Date: Wed, 19 Jul 2023 21:24:54 +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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The O=/path/to/kernel- option allows to build kernel for different architectures in different output directories, in this scene, it doesn't need the mrproper operation for defconfig anymore. If really require to clean up the source code tree, let users run the standalone mrproper target on demand. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 9d9902b54e5e..83cb4b017bef 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -203,7 +203,7 @@ mrproper: $(Q)$(MAKE_KERNEL) mrproper defconfig: - $(Q)$(MAKE_KERNEL) mrproper $(DEFCONFIG) prepare + $(Q)$(MAKE_KERNEL) $(DEFCONFIG) prepare menuconfig: $(Q)$(MAKE_KERNEL) menuconfig From patchwork Wed Jul 19 13:26: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: 704498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D2E0EB64DA for ; Wed, 19 Jul 2023 13:26:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbjGSN0P (ORCPT ); Wed, 19 Jul 2023 09:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjGSN0P (ORCPT ); Wed, 19 Jul 2023 09:26:15 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD116113; Wed, 19 Jul 2023 06:26:13 -0700 (PDT) X-QQ-mid: bizesmtp81t1689773163tzuoiaar Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:26:02 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: Fc2LLDWeHZ8VdczlC7KmDhEPzY0whHqO82tCkg/2DH+O58nfZufXy/1LZ57Ez bYwAChOjliqF3DXvAK8o2kR9iCuiP+OI0g9sAaZVoeK3YF2xhwnh5ghx7bXdO8H43l/aM3m Bru5MzOnEkD7RbQTnvdurcqkRtaa0Ti/iZoRfkPriK1EHO3Ws1mqhylOyC1YXaWKwUc7CbF AqTAxciM24nJjSL+4lOojxVZ5azHBlT3XfogfmGMiSeZhrlYM5F1QSL0avzOy45ESALMgbH yeeImRshlL/b1C1wMCnqkpzfeH3oBhycjOtLHYZgbErbI2rr39HsTvCs2w/7cEVyA1gC7ko D0B/9RqqtA3ECHFY4D4VV5Dt3EgxY3S+JaGfbjxD3iy1CqjTtqVWUT3pKcTuLrvoGRNE4b2 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 17285314132285918324 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 08/14] selftests/nolibc: string the core targets Date: Wed, 19 Jul 2023 21:26:01 +0800 Message-Id: <4d6023634c5d97694e75b460b39c25e44642c4d3.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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, to allow do menuconfig before extconfig manually, only trigger defconfig while the .config is not there, it means only trigger defconfig for the first run or after a mrproper. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 83cb4b017bef..541f3565e584 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -150,6 +150,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,21 +206,28 @@ mrproper: defconfig: $(Q)$(MAKE_KERNEL) $(DEFCONFIG) prepare -menuconfig: +PHONY += $(KERNEL_CONFIG) +$(KERNEL_CONFIG): + $(Q)if [ ! -f "$(KERNEL_CONFIG)" ]; then $(MAKE) --no-print-directory defconfig; fi + +menuconfig: $(KERNEL_CONFIG) $(Q)$(MAKE_KERNEL) menuconfig -extconfig: +extconfig: $(KERNEL_CONFIG) $(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 +kernel: extconfig + $(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) $(LOG_OUT) $(Q)$(REPORT_RUN_OUT) @@ -244,4 +252,4 @@ clean: $(call QUIET_CLEAN, run.out) $(Q)rm -rf run.out -.PHONY: sysroot/$(ARCH)/include +.PHONY: $(PHONY) From patchwork Wed Jul 19 13:27:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 704789 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BFB6EB64DA for ; Wed, 19 Jul 2023 13:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbjGSN1X (ORCPT ); Wed, 19 Jul 2023 09:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjGSN1W (ORCPT ); Wed, 19 Jul 2023 09:27:22 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A53ACFD; Wed, 19 Jul 2023 06:27:19 -0700 (PDT) X-QQ-mid: bizesmtp73t1689773230tl41c04k Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:27:09 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: IcCSTr/hHjObbBazmsx/eCk6zRHzb4DLLNT0pf/dPkYF5A5ior6pI6BCHSsR6 Ls5QcnnivFHHZI0EX9chwHrUZo6HybXN+Cgzuoi7E6aZgU+1yfQ14crWCtNUDJ/gaGFW2uJ TKdt3NDsCDUgg5seMKn0J51fY8ToI5VZY/w04izFonbY4YFDEJIrnxYhSDjhxqDZ4ewz626 vd3bJFiAcB5340nsQBeWRtHGS1WbMKXJCRkw9OxxBQ3cEBkwgvFsiBlpF9UEwYQ2aus0rLT sWs48u3OS58LBsGC0E7Glr5gfeuoGQ6FzjBbri/cuFKmF1qd8LRLfgW5SjbRd2cwRmtU52L D1VhjIeI9q7iCTQGy8HU+Khonc1Zm4NC1RI2YdoZIiKSFIuXtWXikEGBVIvUtwlYWB1rwQd PjYxYlvgGZQ= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11276070205488590152 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 09/14] selftests/nolibc: allow quit qemu-system when poweroff fails Date: Wed, 19 Jul 2023 21:27:08 +0800 Message-Id: <511b2f6009fb830b3f32b4be3dca99596c684fa3.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 value can be configured for every architecture based on their time cost requirement of boot+test+poweroff. Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 541f3565e584..a03fab020ebe 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -93,6 +93,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 = $(QEMU_TIMEOUT_$(XARCH)) + # OUTPUT is only set when run from the main makefile, otherwise # it defaults to this nolibc directory. OUTPUT ?= $(CURDIR)/ @@ -224,16 +227,32 @@ kernel: extconfig # 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) +ifneq ($(QEMU_TIMEOUT),) +TIMEOUT_CMD = t=$(QEMU_TIMEOUT); \ + while [ $$t -gt 0 ]; do \ + sleep 5; t=$$(expr $$t - 5); echo "detecting power off ..."; \ + if grep -qE "reboot: System halted|reboot: Power down" "$(RUN_OUT)"; then \ + pkill -9 qemu-system-$(QEMU_ARCH); \ + echo "powered off, test finish"; t=1; break; \ + fi; \ + done; \ + if [ $$t -le 0 ]; then pkill -9 qemu-system-$(QEMU_ARCH); echo "qemu-system-$(QEMU_ARCH) timeout"; fi + +TIMEOUT_QEMU_RUN = ($(QEMU_SYSTEM_RUN) $(LOG_OUT) &); $(TIMEOUT_CMD) +else +TIMEOUT_QEMU_RUN = $(QEMU_SYSTEM_RUN) $(LOG_OUT) +endif + # run the tests after building the kernel PHONY += $(KERNEL_IMAGE) $(KERNEL_IMAGE): kernel run: $(KERNEL_IMAGE) - $(Q)$(QEMU_SYSTEM_RUN) $(LOG_OUT) + $(Q)$(TIMEOUT_QEMU_RUN) $(Q)$(REPORT_RUN_OUT) # re-run the tests from an existing kernel rerun: - $(Q)$(QEMU_SYSTEM_RUN) $(LOG_OUT) + $(Q)$(TIMEOUT_QEMU_RUN) $(Q)$(REPORT_RUN_OUT) # report with existing test log From patchwork Wed Jul 19 13: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: 704497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2452EEB64DA for ; Wed, 19 Jul 2023 13:28:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230436AbjGSN2b (ORCPT ); Wed, 19 Jul 2023 09:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbjGSN2b (ORCPT ); Wed, 19 Jul 2023 09: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 78BBC113; Wed, 19 Jul 2023 06:28:29 -0700 (PDT) X-QQ-mid: bizesmtp89t1689773299tf1rngp7 Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:28:18 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: D2GZf6M6C/hHMjfdxJUjT9SWMLhUQYgJDIrrFhp+Fwq9+ZemwYDahDg/LFlAP uRCI1W5PfFWLILP0jV14OzSZhvAjwT4JZJTRHhO4PVQ15kr/ZQ9JR0EiD3YRUFfmoLyTf80 yKxjFV5yEYTSI1DpVfwYWdjzZfsjO0jxhtzaevKeOxSD7/EDiON1DMkYCuFlJWao2CHZsB1 NuZOf4qzhHOsFYbXDTlblJbeiiBHtfZg4hVxHnklzJNXeNQDqzWrJ1Cqg5dTF9zMTjNHTEd 6QAsOoq2RCed4fNTKqx0EkMJo4aEfJ/+A00vEnNrMqR0/UFliRfBSKlMwmCmbzvbnXpYJ72 PPDNYb1Hfc1LYSjQCQjC5CSXp1FCMsjHCP83F8/1Gb+DCR0ezn5mcb1eyrM4w== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 12822490735475471790 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 10/14] selftests/nolibc: allow customize CROSS_COMPILE by architecture Date: Wed, 19 Jul 2023 21:28:17 +0800 Message-Id: <39df39b4023831b796a1b21c7e31f4be0b432416.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Some cross compilers may not just be prefixed with ARCH or XARCH, customize them by architecture may easier the test a lot, especially, when iterate with XARCH or ARCH. After customizing this for every architecture, the minimal test argument will be architecture itself, no CROSS_COMPILE will be passed. If the installed cross compiler is not the same as the one customized, we can also pass CROSS_COMPILE from command line as before, no regression. 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 a03fab020ebe..3c2be27747ea 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -42,6 +42,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 Wed Jul 19 13: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: 704788 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5504C001B0 for ; Wed, 19 Jul 2023 13:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231293AbjGSN3h (ORCPT ); Wed, 19 Jul 2023 09:29:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbjGSN3g (ORCPT ); Wed, 19 Jul 2023 09:29:36 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D917CD; Wed, 19 Jul 2023 06:29:35 -0700 (PDT) X-QQ-mid: bizesmtp64t1689773366ta76pyye Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:29:25 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: LE7C6P2vL8Q0BfRZgcjdiJo/UnSCVOS7IsH3kWwbRfH751nnH5xq5eegkb9A2 fIPhBWPApGLEc4HeEOh9ygUCa1hiysXtH+GoUhabzIewq4cHCs0VvUrucmoUpPo/CW3mduS dnAMPba5AQnAdblgdV+pfY/UKnR0FRv6U2/uyqXm3kgl4Z54ucn6Ifaw56tFSqCDe0Cp/FJ 349rlhWoDaRkk2l5RshiaORaK9Dg7I9UC2ThBpndLQC3IT7lweIiUO5odkE5wsOpd1hVdn4 NBQQ4Ld0AAZyumP4QjkWIKvsuaBBaxqaRJXbpFNEbzk1mj6+CecA69hItVvArxI8I6XYEb2 DJA56O+h4dTZ+Z/GIORbsN96NTx7vb9iyJmj0n+c/fBq0ye9Axb+YJ73hz7W+QmxxFLhtGN I+Qth9VpW/4= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 12510972291821297194 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 11/14] selftests/nolibc: customize CROSS_COMPILE for 32/64-bit powerpc Date: Wed, 19 Jul 2023 21:29:24 +0800 Message-Id: <3056b81ad829b512ef89c2ae0772d92b69efa0cf.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 us to test target architectures with: $ cd /path/to/tools/testing/selftests/nolibc/ $ for arch in powerpc powerpc64 powerpc64le; do \ make run-user XARCH=$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_powerpc64=powerpc64-linux- $ export CROSS_COMPILE_powerpc64le=powerpc64-linux- $ for arch in powerpc64 powerpc64le; do \ make run-user XARCH=$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 powerpc64 powerpc64le; do \ make run-user XARCH=$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 3c2be27747ea..eec2935672ad 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -43,6 +43,9 @@ IMAGE = $(IMAGE_$(XARCH)) IMAGE_NAME = $(notdir $(IMAGE)) # CROSS_COMPILE: cross toolchain prefix by architecture +CROSS_COMPILE_powerpc ?= powerpc-linux-gnu- +CROSS_COMPILE_powerpc64 ?= powerpc64le-linux-gnu- +CROSS_COMPILE_powerpc64le ?= powerpc64le-linux-gnu- CROSS_COMPILE ?= $(CROSS_COMPILE_$(XARCH)) # make sure CC is prefixed with CROSS_COMPILE From patchwork Wed Jul 19 13:30:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 704496 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33FBDEB64DA for ; Wed, 19 Jul 2023 13:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231302AbjGSNan (ORCPT ); Wed, 19 Jul 2023 09:30:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbjGSNam (ORCPT ); Wed, 19 Jul 2023 09:30:42 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D3E9119; Wed, 19 Jul 2023 06:30:41 -0700 (PDT) X-QQ-mid: bizesmtp91t1689773432tb4871u6 Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:30:31 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: znfcQSa1hKZ1OQVbZm+fYY1B+tno47akE8kAbUd2dOiIVMXsv+x77PjmcbbxG QQwSGPDuT2Ta2tyfCPgJY0MbBj9YfjoJ1G63UpQHS/gKrKTZWF++i0e3ZjQNw/Z8CKGWKdB jF77VI+jRPKeoa1A1rgUNQ7srXpFh8OB2c2l1RsiS2WbFGnj7zvSg/1UXBoZ8XXgHrsCP5A py/ktvPqt7OISRTjBkt2laot2vDJ1SlnxBw60YFam56zhhmiFedmCPa/SxegPJVvV9KYwEY I5kQ3aNo3tF5EmEyMQp9Burv6ssscVMLThU5PMviXGQF8IR99S//QS8OD15WS/+Tu5DLwhg JDPLtJcquCPYyBWUNYr/bzIwCulI5ZFzjUAwmBBkFp/BHR0VKvvIHRb0+1A7A== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 4621016987773429501 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 12/14] selftests/nolibc: add tinyconfig target Date: Wed, 19 Jul 2023 21:30:30 +0800 Message-Id: <6c58b9bec8fdf593d5dd1d5ba55aabddb0ce02d1.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The original tinyconfig target only enables minimal kernel config options, it can speed up the kernel build and nolibc test a lot and also brings us with smaller kernel image size. But the default enabled options are not enough for qemu boot and console print, some additional config options should be added for every architecture individually. 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 eec2935672ad..f42782fa78a9 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -218,6 +218,9 @@ mrproper: defconfig: $(Q)$(MAKE_KERNEL) $(DEFCONFIG) prepare +tinyconfig: + $(Q)$(MAKE_KERNEL) tinyconfig prepare + PHONY += $(KERNEL_CONFIG) $(KERNEL_CONFIG): $(Q)if [ ! -f "$(KERNEL_CONFIG)" ]; then $(MAKE) --no-print-directory defconfig; fi From patchwork Wed Jul 19 13:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 704787 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 948ACEB64DA for ; Wed, 19 Jul 2023 13:31:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231319AbjGSNbz (ORCPT ); Wed, 19 Jul 2023 09:31:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbjGSNby (ORCPT ); Wed, 19 Jul 2023 09:31:54 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30900CD; Wed, 19 Jul 2023 06:31:52 -0700 (PDT) X-QQ-mid: bizesmtp81t1689773502tmfcw477 Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:31:41 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: vrqOr+ppv0tG8gKNCr4DgHiL+u0a/TSKoOLUX8xn2sq9UVKoRAsfkpAEyQPY9 oCQR51MHuWU/N+/ngwuvVtATNosU7ftdsbnXbegbY13KJwm+Kkt/dFGRLUVMwD98dDw7JYa hlSJOBi7BbAM/z0kuz9ftpQyqi6FoMzGdXYJ6Yx399eyEvzRu+E+mmKVKhaW/+9yXI3vOr6 zASQQARGKlU3nvkQNtGspRwEiAuHDGTzmOkXeBfkQH26Ix6eUke+idAdo7qbJcop0WWvewr PFjspLHtPixWHs7x0RX3OxwmZD3Nb5il4lMd9IDj1q27M1pjwzLzAbxp5UIBdUeFk/nCvx/ 8VQFB8K41rAmRRiM3PQhV3hfqHan9+GHCl8B41LGXT3lb5+/SbW8cVN0oXWRwhgSm8FH3Zn X-QQ-GoodBg: 0 X-BIZMAIL-ID: 13303215670408081190 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 13/14] selftests/nolibc: tinyconfig: add extra common options Date: Wed, 19 Jul 2023 21:31:36 +0800 Message-Id: <7ae0bec89a7d810415fb2728e48465458ba364bd.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The original kernel tinyconfig target 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 Wed Jul 19 13: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: 704495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E392AEB64DA for ; Wed, 19 Jul 2023 13:33:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbjGSNdB (ORCPT ); Wed, 19 Jul 2023 09:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230509AbjGSNdB (ORCPT ); Wed, 19 Jul 2023 09:33:01 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69FF610A; Wed, 19 Jul 2023 06:32:58 -0700 (PDT) X-QQ-mid: bizesmtp79t1689773568tihiumin Received: from linux-lab-host.localdomain ( [119.123.130.39]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 19 Jul 2023 21:32:47 +0800 (CST) X-QQ-SSF: 01200000000000D0X000000A0000000 X-QQ-FEAT: vrqOr+ppv0uPJA1yEKpWWkVnlUVqK6PuuvjdcyUHTrqkd/pqeEmMWxHZikDYj CkZ8/RJXIHvgLJf2jqgOcGTFxCd/FQ5bl379HoWrd8vkibnH47pU5q0kP+sxxDjREvmZU+e be2EPxscjn2d7Dfo95eemVORbMsNqsAUq5tF5GbGkP5HsHyifNSJktBae+cshFgImccttiP 47/eb2g/JI2ocs7p12XfFJuF0kjb2M2KZRL7Ly1g1lw/eOebxaWOu/oZoA/re3h4LpsrvO2 jkRTyhWJYBER4Mk/Ustf6yzF1N4ex+pClTbjBlYQqEP6IRtHjD+qNfNume0CK7azkie0Tyr cJmGlgv+Ywb02/GEHq9Pt9+CZN8PGY7gnG7AVQ+U/bJJ/ycN9CF698Aq+ekGQbC0vx2kUfv X-QQ-GoodBg: 0 X-BIZMAIL-ID: 3748257128951603751 From: Zhangjin Wu To: w@1wt.eu Cc: thomas@t-8ch.de, arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 14/14] selftests/nolibc: tinyconfig: add support for 32/64-bit powerpc Date: Wed, 19 Jul 2023 21:32:46 +0800 Message-Id: <15b47c6901f79a22b985a53efeae71dc7b172a5f.1689759351.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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Firstly, add extra config files for powerpc, powerpc64le and powerpc64. Second, QEMU_TIMEOUT is configured as 60 seconds for powerpc to allow quit qemu-system-ppc even if poweroff fails. In normal host machine, ~20 seconds may be enough for boot+test+poweroff, but 60 seconds is used here to gurantee it at least finish even in a very slow host machine or the host machine is too busy. Both powerpc64le and powerpc64 can poweroff normally, no need to configure QEMU_TIMEOUT for them. It is able to use tinyconfig as the minimal config target to speed up the run target of powerpc: $ for arch in powerpc powerpc64 powerpc64le; do \ rm -rf $PWD/kernel-$arch; \ mkdir -p $PWD/kernel-$arch; \ make tinyconfig run XARCH=$arch O=$PWD/kernel-$arch | grep status ; \ done rerun with architecture specific run.out (for later report): $ for arch in powerpc powerpc64 powerpc64le; do \ mkdir -p $PWD/kernel-$arch; \ make rerun XARCH=$arch O=$PWD/kernel-$arch RUN_OUT=$PWD/run.$arch.out | grep status ; \ done report: $ 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/Makefile | 1 + tools/testing/selftests/nolibc/configs/powerpc.config | 3 +++ tools/testing/selftests/nolibc/configs/powerpc64.config | 3 +++ tools/testing/selftests/nolibc/configs/powerpc64le.config | 4 ++++ 4 files changed, 11 insertions(+) create mode 100644 tools/testing/selftests/nolibc/configs/powerpc64.config create mode 100644 tools/testing/selftests/nolibc/configs/powerpc64le.config diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index f42782fa78a9..b01346323e35 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -103,6 +103,7 @@ 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_powerpc = 60 QEMU_TIMEOUT = $(QEMU_TIMEOUT_$(XARCH)) # OUTPUT is only set when run from the main makefile, otherwise diff --git a/tools/testing/selftests/nolibc/configs/powerpc.config b/tools/testing/selftests/nolibc/configs/powerpc.config index b1975f8253f7..29123cee14c4 100644 --- a/tools/testing/selftests/nolibc/configs/powerpc.config +++ b/tools/testing/selftests/nolibc/configs/powerpc.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/powerpc64.config b/tools/testing/selftests/nolibc/configs/powerpc64.config new file mode 100644 index 000000000000..4e17f0cdb99f --- /dev/null +++ b/tools/testing/selftests/nolibc/configs/powerpc64.config @@ -0,0 +1,3 @@ +CONFIG_PPC64=y +CONFIG_PPC_POWERNV=y +CONFIG_HVC_OPAL=y diff --git a/tools/testing/selftests/nolibc/configs/powerpc64le.config b/tools/testing/selftests/nolibc/configs/powerpc64le.config new file mode 100644 index 000000000000..713b227f506f --- /dev/null +++ b/tools/testing/selftests/nolibc/configs/powerpc64le.config @@ -0,0 +1,4 @@ +CONFIG_PPC64=y +CONFIG_PPC_POWERNV=y +CONFIG_HVC_OPAL=y +CONFIG_CPU_LITTLE_ENDIAN=y