From patchwork Wed Jun 12 05:23:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1946640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=K/BcPLnV; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=QT/Nj8jL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzYqx0pgXz20Pb for ; Wed, 12 Jun 2024 15:24:12 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BhdvQXfM22SnyDkIkhrGZIUSAILj1QpFC0RocIFcJBk=; b=K/BcPLnVh44Sav 5OInrFul0evIIf6EyVy7enyoRYbBpk4rnH2yIuj5Hwz75+V7x24a7cKs9HQVejVuWsl5gPaw2AgW7 LvgHzdKubaV31fDenPvc2otQn/zVwmlrzLKIVblv2xQpOgTfEyy0iAhXiRdfDdG5bgIsf2vCZdosy AgZhq8+XmwcvziuHoYh/bCV0pfGX0tchfdxOEIH7E9fRhCFOwBwLuXgNBYOCa/ftIt21gpgy7jNn6 F38tsVLTCU8pV9RrF7wj904y6ritqZ+A7e9GWcdaE/yQHTqqsuoHDFG7mpc1428LS01BeGfdUgAP6 cAl8XAkeTfA8k/5GGigw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHGSx-0000000B8sg-0KAb; Wed, 12 Jun 2024 05:24:11 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHGSu-0000000B8rr-1m9h for kvm-riscv@lists.infradead.org; Wed, 12 Jun 2024 05:24:10 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1f47f07acd3so59132525ad.0 for ; Tue, 11 Jun 2024 22:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718169847; x=1718774647; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cQuI8YGQgLmsUNQvvWuFnLsfcid8kBB0k+CZ86TDvAk=; b=QT/Nj8jLSK9f9Ts9LMeDcP3n/WdLv4qNKK9QjhSr75BoDsVXGt6MonqMJKRAcKZiDD pvqrcknpEpAHZGi/g83AVRxJd0UJxiq0TzPMijCnk6Z86TMKQP+uQURf6EdYNg5yIiZT wMIsLY01zlB6QVxq5Q0M+ufqdUnhz5DLZnS0IDJpSY26ht3NThCb0/FQOJkTwAWml5PG dDzb/eVE1UO2okf+FciZm7J0A9pi4z7vZXMmgGVp0Kuvza40qcQUXVkfFXunKHfILo6D YaeNoF9anSjnXV5UQOVbVPUrnnryHB5MElh3WCC8eOUIdVzEuhCmHE9JZXIQITbnQ/ff ZHQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718169847; x=1718774647; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cQuI8YGQgLmsUNQvvWuFnLsfcid8kBB0k+CZ86TDvAk=; b=sxZShvyBc2f/y2kl/hDyYzRnbvHqvZg06uwcnDxSllfOOECGd42MxtkV+P8mBv30Np T/siCg3vd7xGa7sfEGyrSJhAL6b0ZpAVuznRNVZtqTwlvjj3NUAcHOFW1FTf2Hal5Ku3 kiai5Do15qUCatkC2CnRyRgDewvImvWhRTB2ox8Qgl1525NJQFHFqFQ2a47YOMc5woLN Nfe//e8O75/4+H2ZOh9CnEnW4EABtZOYZr4kqywQLRgq65egbxuvLKaR6Y9eWcKSzaBx VnFLOX6SeVQaw4JZwSUg+9kG0JMrNWb+KUpbkO/m9GVBW2Uysq/h3aotSQ5NMvSKLJ4h S4fg== X-Forwarded-Encrypted: i=1; AJvYcCX3Dh8S8C+LgKQsBoKisix8aNKvCCyfYjDqXVrOKlgJfpUa6Z1w66oQtdEJUAIQMpPVbxKI7XWKdrlvwEbHYINUDVjOalnX2sf7zv+9Mg== X-Gm-Message-State: AOJu0YzIBOKxqwKxMnoLze6yO1DAksDIMjA2wgvgijhAWi0G1C7U6dtr hm31aM8gjGVxql6N27mIbSLNSMe6ir2dXYX7os3KxkHvqO8iuIzhLc8GBQ== X-Google-Smtp-Source: AGHT+IGibBQ31aFbHM2KNIyG3WXGmC6uDThIWGe0iAzdMLifnbTThBiAhC+djmwgDB3YyNkgibzPkg== X-Received: by 2002:a17:902:ceca:b0:1f7:969:7e87 with SMTP id d9443c01a7336-1f83b666b52mr10420065ad.35.1718169846856; Tue, 11 Jun 2024 22:24:06 -0700 (PDT) Received: from wheely.local0.net (220-235-199-47.tpgi.com.au. [220.235.199.47]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd75f711sm112170705ad.11.2024.06.11.22.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 22:24:06 -0700 (PDT) From: Nicholas Piggin To: Thomas Huth Cc: Nicholas Piggin , Laurent Vivier , Andrew Jones , linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, Alexandru Elisei , Claudio Imbrenda , David Hildenbrand , Eric Auger , Janosch Frank , =?utf-8?q?Nico_B=C3=B6hr?= , Paolo Bonzini , linux-s390@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org Subject: [kvm-unit-tests PATCH v10 09/15] configure: Make arch_libdir a first-class entity Date: Wed, 12 Jun 2024 15:23:14 +1000 Message-ID: <20240612052322.218726-10-npiggin@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240612052322.218726-1-npiggin@gmail.com> References: <20240612052322.218726-1-npiggin@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240611_222408_488267_C34B980C X-CRM114-Status: GOOD ( 11.73 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: arch_libdir was brought in to improve the heuristic determination of the lib/ directory based on arch and testdir names, but it did not entirely clean that mess up. Remove the arch_libdir->arch->testdir heuristic and just require everybody sets arch_libdir correctly. Fail if the lib/arch or lib/arch/asm directories can not be found. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [npiggin(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:636 listed in] [list.dnswl.org] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org arch_libdir was brought in to improve the heuristic determination of the lib/ directory based on arch and testdir names, but it did not entirely clean that mess up. Remove the arch_libdir->arch->testdir heuristic and just require everybody sets arch_libdir correctly. Fail if the lib/arch or lib/arch/asm directories can not be found. Cc: Alexandru Elisei Cc: Claudio Imbrenda Cc: David Hildenbrand Cc: Eric Auger Cc: Janosch Frank Cc: Laurent Vivier Cc: Nico Böhr Cc: Paolo Bonzini Cc: Thomas Huth Cc: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: kvmarm@lists.linux.dev Cc: kvm-riscv@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- Makefile | 2 +- configure | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5b7998b79..7fe93dfd8 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ include config.mak VPATH = $(SRCDIR) libdirs-get = $(shell [ -d "lib/$(1)" ] && echo "lib/$(1) lib/$(1)/asm") -ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR)) $(call libdirs-get,$(TEST_DIR)) +ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR)) OBJDIRS := $(ARCH_LIBDIRS) DESTDIR := $(PREFIX)/share/kvm-unit-tests/ diff --git a/configure b/configure index db15e85d6..b93723142 100755 --- a/configure +++ b/configure @@ -217,7 +217,6 @@ fi arch_name=$arch [ "$arch" = "aarch64" ] && arch="arm64" [ "$arch_name" = "arm64" ] && arch_name="aarch64" -arch_libdir=$arch if [ "$arch" = "riscv" ]; then echo "riscv32 or riscv64 must be specified" @@ -285,8 +284,10 @@ fi if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then testdir=x86 + arch_libdir=x86 elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then testdir=arm + arch_libdir=$arch if [ "$target" = "qemu" ]; then arm_uart_early_addr=0x09000000 elif [ "$target" = "kvmtool" ]; then @@ -335,6 +336,7 @@ elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then fi elif [ "$arch" = "ppc64" ]; then testdir=powerpc + arch_libdir=ppc64 firmware="$testdir/boot_rom.bin" if [ "$endian" != "little" ] && [ "$endian" != "big" ]; then echo "You must provide endianness (big or little)!" @@ -345,6 +347,7 @@ elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then arch_libdir=riscv elif [ "$arch" = "s390x" ]; then testdir=s390x + arch_libdir=s390x else echo "arch $arch is not supported!" arch= @@ -354,6 +357,10 @@ if [ ! -d "$srcdir/$testdir" ]; then echo "$srcdir/$testdir does not exist!" exit 1 fi +if [ ! -d "$srcdir/lib/$arch_libdir" ]; then + echo "$srcdir/lib/$arch_libdir does not exist!" + exit 1 +fi if [ "$efi" = "y" ] && [ -f "$srcdir/$testdir/efi/run" ]; then ln -fs "$srcdir/$testdir/efi/run" $testdir-run @@ -416,10 +423,11 @@ fi # link lib/asm for the architecture rm -f lib/asm asm="asm-generic" -if [ -d "$srcdir/lib/$arch/asm" ]; then - asm="$srcdir/lib/$arch/asm" -elif [ -d "$srcdir/lib/$testdir/asm" ]; then - asm="$srcdir/lib/$testdir/asm" +if [ -d "$srcdir/lib/$arch_libdir/asm" ]; then + asm="$srcdir/lib/$arch_libdir/asm" +else + echo "$srcdir/lib/$arch_libdir/asm does not exist" + exit 1 fi mkdir -p lib ln -sf "$asm" lib/asm