From patchwork Tue Oct 10 12:33:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 732327 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 E4FB5CD80C1 for ; Tue, 10 Oct 2023 12:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231959AbjJJMeU (ORCPT ); Tue, 10 Oct 2023 08:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231926AbjJJMeR (ORCPT ); Tue, 10 Oct 2023 08:34:17 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF3D5115; Tue, 10 Oct 2023 05:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1696941245; bh=fsO74MWqtM4jVQuGUdntQXoI033jmuUmq363SjvsrzE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PMAns0zZx3Np5CZIIV5quub/x4ZRSTDxPXg9ff+629CjRY8nc8NJM7Lb+juwV3XHz 5KOj4pqFlmZnMPymL4SehEzB/S9U7gpIiZn/UZsgeG9eZ7bzbpMcPdfPFhAEvxrjjR SAyA16qH6ln4og1bVtnXt/unzItw1kGTT+tU//Qw= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 10 Oct 2023 14:33:56 +0200 Subject: [PATCH 1/5] selftests/nolibc: use qemu-system-ppc64 also for ppc64le MIME-Version: 1.0 Message-Id: <20231010-nolibc-out-of-tree-v1-1-b6a263859596@weissschuh.net> References: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> In-Reply-To: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1696941244; l=992; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=fsO74MWqtM4jVQuGUdntQXoI033jmuUmq363SjvsrzE=; b=wBSRpTIRiZpeQkBRJz5IkeqbVATp2Vm3/3mSLvtxPjEqug6p2AE6S8BcC7VaMG9QkRctG4DKq 1EpwfekvHEACtwJLn0KV+nDLNowX1elG/TuCScWOv7UJCRd/xdY4xNn X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org qemu-system-ppc64 can handle both big and little endian kernels. While some setups, like Debian, provide a symlink to execute qemu-system-ppc64 as qemu-system-ppc64le, others, like ArchLinux, do not. So always use qemu-system-ppc64 directly. Signed-off-by: Thomas Weißschuh --- 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 891aa396163d..af60e07d3c12 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -82,7 +82,7 @@ QEMU_ARCH_arm = arm QEMU_ARCH_mips = mipsel # works with malta_defconfig QEMU_ARCH_ppc = ppc QEMU_ARCH_ppc64 = ppc64 -QEMU_ARCH_ppc64le = ppc64le +QEMU_ARCH_ppc64le = ppc64 QEMU_ARCH_riscv = riscv64 QEMU_ARCH_s390 = s390x QEMU_ARCH_loongarch = loongarch64 From patchwork Tue Oct 10 12:33:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 731727 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 CCA3CCD80C0 for ; Tue, 10 Oct 2023 12:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbjJJMeT (ORCPT ); Tue, 10 Oct 2023 08:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231905AbjJJMeR (ORCPT ); Tue, 10 Oct 2023 08:34:17 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 907ECF0; Tue, 10 Oct 2023 05:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1696941245; bh=kXS7WhluAd4PiUUxRUCXnsXLrFdoS1vueCxpn04VTXE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=R0WpHc8XQvn1Lji8rx5D6JKLLm6M9P6qaJYMFzgOu2iTe1Qg8jh7jI8TK+CjuABax ojMk4Heqk1IAnnbBYg7nOSp8qbKSO3FVazcdarSvueJfHW8l+e6AGYosXVvN7VoG4A Rhvxgg7pawEKVX3K8e6iEg8+3tUFU8o9y/qpW6LU= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 10 Oct 2023 14:33:57 +0200 Subject: [PATCH 2/5] selftests/nolibc: use EFI -bios for LoongArch qemu MIME-Version: 1.0 Message-Id: <20231010-nolibc-out-of-tree-v1-2-b6a263859596@weissschuh.net> References: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> In-Reply-To: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1696941244; l=1717; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=kXS7WhluAd4PiUUxRUCXnsXLrFdoS1vueCxpn04VTXE=; b=mRJ10rNacYK1RUuAziauqWSviXnEL+7fllM4ClTgv0Qep9/tmh+FYPxesyXQHxDXpKS8EIs7m uxCVv7/ALa2BuA2ZMIFijBikPeE+RdpiMB6+7/7LSYovSINaHjBTpSn X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org qemu for LoongArch does not work properly with direct kernel boot. The kernel will panic during initialization and hang without any output. When booting in EFI mode everything work correctly. While users most likely don't have the LoongArch EFI binary installed at least an explicit error about 'file not found' is better than a hanging test without output that can never succeed. Link: https://lore.kernel.org/loongarch/1738d60a-df3a-4102-b1da-d16a29b6e06a@t-8ch.de/ Signed-off-by: Thomas Weißschuh --- Note: I'm wondering how this worked for anybody else. --- 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 af60e07d3c12..258293639572 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -100,7 +100,7 @@ QEMU_ARGS_ppc64 = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC QEMU_ARGS_ppc64le = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_riscv = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_s390 = -M s390-ccw-virtio -m 1G -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" -QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" +QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" -bios /usr/share/edk2/loongarch64/OVMF_CODE.fd QEMU_ARGS = $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_EXTRA) # OUTPUT is only set when run from the main makefile, otherwise From patchwork Tue Oct 10 12:33:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 731725 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 93D67CD80C6 for ; Tue, 10 Oct 2023 12:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229508AbjJJMeV (ORCPT ); Tue, 10 Oct 2023 08:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231928AbjJJMeR (ORCPT ); Tue, 10 Oct 2023 08:34:17 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A6EF11C; Tue, 10 Oct 2023 05:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1696941245; bh=hixffEo6Od5BKvLAa5YL7lg4UjAnDYgxCrpKJ2QsowA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lx3KNP+OrSMDesEOP/6O8tZLVwMGi+QevwDFDT3qHF8IG2SUsmA2KIGHH73jpOzLf npr7PcECkFSkT4sYG6x2UbQQny2sDepg6BCl/QEfgYdb06yRzINCiA7EU/VCjHj0S1 kbLHyuDcldSRxw8ayz5FWXyGMzlY6DLizCvmnE+o= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 10 Oct 2023 14:33:58 +0200 Subject: [PATCH 3/5] selftests/nolibc: anchor paths in $(srcdir) if possible MIME-Version: 1.0 Message-Id: <20231010-nolibc-out-of-tree-v1-3-b6a263859596@weissschuh.net> References: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> In-Reply-To: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1696941244; l=1347; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=hixffEo6Od5BKvLAa5YL7lg4UjAnDYgxCrpKJ2QsowA=; b=Yeyu0n2VOJ82yYaeMfS6OUy6louhOtnaeMYZ7aWmOmVdzx6zfBp8W8AkTzKCUwHkpvTQRI4No 78YKz0kxgnBBHULSkIKMMgOCz9Uy3ABmI7jRCvB1TI1l3xqRlPyv6Mn X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org It is easier to recognize paths from their well-known location in the source tree than having to resolve the relative path in ones head. Signed-off-by: Thomas Weißschuh --- 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 258293639572..598d53c5cb7b 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -167,7 +167,7 @@ sysroot: 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) -C $(srctree)/tools/include/nolibc ARCH=$(ARCH) OUTPUT=$(CURDIR)/sysroot/ headers_standalone $(Q)mv sysroot/sysroot sysroot/$(ARCH) ifneq ($(NOLIBC_SYSROOT),0) @@ -177,7 +177,7 @@ nolibc-test: nolibc-test.c sysroot/$(ARCH)/include else nolibc-test: nolibc-test.c $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ \ - -nostdlib -static -include ../../../include/nolibc/nolibc.h $< -lgcc + -nostdlib -static -include $(srctree)/tools/include/nolibc/nolibc.h $< -lgcc endif libc-test: nolibc-test.c From patchwork Tue Oct 10 12:33:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 731726 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 2DD6BCD80C3 for ; Tue, 10 Oct 2023 12:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232014AbjJJMeV (ORCPT ); Tue, 10 Oct 2023 08:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231963AbjJJMeR (ORCPT ); Tue, 10 Oct 2023 08:34:17 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00A8C11B; Tue, 10 Oct 2023 05:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1696941245; bh=WxAUHJdppCeTHqWPxWpmIL5UmHFcwDBRqVdmTVlGl0U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VEUfNKVPa1jAF4dH/OyzXoKzbUul33LreA4uDaGopOnVixMFIEsnEKf8w1zTyA67o /BVTpB6u1/jw6W6yJ1YCcXJ4B1sCMEI9PZSMbCTZ3PHO2mRm97tRQKb9dpdpq4Ytw5 K6BpTXC/OwCtATJeHVQqXe0Za+nn2ObdUIEJ/VOM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 10 Oct 2023 14:33:59 +0200 Subject: [PATCH 4/5] selftests/nolibc: support out-of-tree builds MIME-Version: 1.0 Message-Id: <20231010-nolibc-out-of-tree-v1-4-b6a263859596@weissschuh.net> References: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> In-Reply-To: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1696941244; l=3951; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=WxAUHJdppCeTHqWPxWpmIL5UmHFcwDBRqVdmTVlGl0U=; b=/UOEch0A9EzSGr6yYRgdHzLhXIl9y7lRmAKNd1nuNPkIzI2sd3nn09koPBt6Crej7vYWswndr lGWQRved7EQCJ2CVmPRuAkpL/QjE2k/JMU3S/GKy7DF/1OGERqN19YQ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Out of tree builds are much more convenient when building for multiple architectures or configurations in parallel. Only absolute O= parameters are supported as Makefile.include will always resolve relative paths in relation to $(srctree) instead of the current directory. Add a call to "make outputmakefile" to verify that the sourcetree is clean. This is based on Zhangjins out-of-tree patch. It extends that work for get_init_cpio support and also drops relative O= specifications explicitly. Link: https://lore.kernel.org/lkml/06d96bd81fe812a9718098a383678ad3beba98b1.1691215074.git.falcon@tinylab.org/ Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 598d53c5cb7b..21e3f7da2ecf 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -1,9 +1,16 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for nolibc tests include ../../../scripts/Makefile.include +include ../../../scripts/utilities.mak # We need this for the "cc-option" macro. include ../../../build/Build.include +ifneq ($(O),) +ifneq ($(call is-absolute,$(O)),y) +$(error Only absolute O= parameters are supported) +endif +endif + # we're in ".../tools/testing/selftests/nolibc" ifeq ($(srctree),) srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR))) @@ -14,6 +21,8 @@ include $(srctree)/scripts/subarch.include ARCH = $(SUBARCH) endif +objtree ?= $(srctree) + # XARCH extends the kernel's ARCH with a few variants of the same # architecture that only differ by the configuration, the toolchain # and the Qemu program used. It is copied as-is into ARCH except for @@ -52,7 +61,7 @@ IMAGE_ppc64le = arch/powerpc/boot/zImage IMAGE_riscv = arch/riscv/boot/Image IMAGE_s390 = arch/s390/boot/bzImage IMAGE_loongarch = arch/loongarch/boot/vmlinuz.efi -IMAGE = $(IMAGE_$(XARCH)) +IMAGE = $(objtree)/$(IMAGE_$(XARCH)) IMAGE_NAME = $(notdir $(IMAGE)) # default kernel configurations that appear to be usable @@ -167,6 +176,7 @@ sysroot: sysroot/$(ARCH)/include sysroot/$(ARCH)/include: $(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot $(QUIET_MKDIR)mkdir -p sysroot + $(Q)$(MAKE) -C $(srctree) outputmakefile $(Q)$(MAKE) -C $(srctree)/tools/include/nolibc ARCH=$(ARCH) OUTPUT=$(CURDIR)/sysroot/ headers_standalone $(Q)mv sysroot/sysroot sysroot/$(ARCH) @@ -199,7 +209,7 @@ run-user: nolibc-test $(Q)$(REPORT) $(CURDIR)/run.out initramfs.cpio: kernel nolibc-test - $(QUIET_GEN)echo 'file /init nolibc-test 755 0 0' | $(srctree)/usr/gen_init_cpio - > initramfs.cpio + $(QUIET_GEN)echo 'file /init nolibc-test 755 0 0' | $(objtree)/usr/gen_init_cpio - > initramfs.cpio initramfs: nolibc-test $(QUIET_MKDIR)mkdir -p initramfs @@ -217,12 +227,12 @@ kernel-standalone: initramfs # run the tests after building the kernel run: kernel initramfs.cpio - $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -initrd initramfs.cpio -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" + $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(IMAGE)" -initrd initramfs.cpio -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" $(Q)$(REPORT) $(CURDIR)/run.out # re-run the tests from an existing kernel rerun: - $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(srctree)/$(IMAGE)" -initrd initramfs.cpio -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" + $(Q)qemu-system-$(QEMU_ARCH) -display none -no-reboot -kernel "$(IMAGE)" -initrd initramfs.cpio -serial stdio $(QEMU_ARGS) > "$(CURDIR)/run.out" $(Q)$(REPORT) $(CURDIR)/run.out # report with existing test log From patchwork Tue Oct 10 12:34:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 732326 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 98ABBCD80BD for ; Tue, 10 Oct 2023 12:34:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231609AbjJJMeX (ORCPT ); Tue, 10 Oct 2023 08:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbjJJMeU (ORCPT ); Tue, 10 Oct 2023 08:34:20 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3727310C; Tue, 10 Oct 2023 05:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1696941246; bh=itCOy/n/isHYcQulK5emf3FoLnD4SemWjOxOW/MPxRU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cFd0HdMoqAGecyLpraySfzYGr81X8M9XAdG8/b2/LiqZQyHu/7QsZQ8ET5a3nVkgZ 6QgRnssxfnhVUh0zzE6GweAt8SXRQO1vtH9Hw9LtGsL1XKlkRSRPFNQcOSxbqi99jZ YTpdmdeQK5MQksUv/baRtd2BraVENnyBcd84/mH0= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 10 Oct 2023 14:34:00 +0200 Subject: [PATCH 5/5] selftests/nolibc: generate config automatically MIME-Version: 1.0 Message-Id: <20231010-nolibc-out-of-tree-v1-5-b6a263859596@weissschuh.net> References: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> In-Reply-To: <20231010-nolibc-out-of-tree-v1-0-b6a263859596@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: Zhangjin Wu , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1696941244; l=1742; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=itCOy/n/isHYcQulK5emf3FoLnD4SemWjOxOW/MPxRU=; b=FZZ9E3TluP14IhqlqbPbtRKKsEauXukQv98Yt6wYhopJ6+aRz22BRfiyu+SEtUioUGvNvBZen sJzKTnj2q8jCBaMkfPEKO/yzZN3Yn+fUb3FskXxux3tYKjmUAjq9frV X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org This new target generates a .config if none exists yet. Also drop the defconfig target with its hidden call to 'mrproper' which is fairly invasive. If users want to overwrite their kernel existing kernel configuration they can do so easily from the toplevel directory. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 21e3f7da2ecf..5a3623680f1a 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -173,7 +173,7 @@ all: run sysroot: sysroot/$(ARCH)/include -sysroot/$(ARCH)/include: +sysroot/$(ARCH)/include: $(objtree)/.config $(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot $(QUIET_MKDIR)mkdir -p sysroot $(Q)$(MAKE) -C $(srctree) outputmakefile @@ -216,13 +216,13 @@ initramfs: nolibc-test $(call QUIET_INSTALL, initramfs/init) $(Q)cp nolibc-test initramfs/init -defconfig: - $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare +$(objtree)/.config: + $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(DEFCONFIG) -kernel: +kernel: $(objtree)/.config $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) -kernel-standalone: initramfs +kernel-standalone: $(objtree)/.config initramfs $(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) $(IMAGE_NAME) CONFIG_INITRAMFS_SOURCE=$(CURDIR)/initramfs # run the tests after building the kernel