From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1890606A322 for ; Wed, 2 Dec 2026 00:40:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=SuPjnjmR; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=cISeon3Z 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:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Unsubscribe-Post:List-Owner; bh=754Ker4gSDqhsi834vJQWDRnczt4D2vmfVEN70eKzhQ=; b=SuPjnjmRQry7VJOosFVR6rBLj4 KyjgTM9rzkIxTe5wajmejvDdNcvxabEcPAcT6WDcNTinQv0lHY+xnGZUvGQ0SG2V+mI16Qg77Q/li SNww3hXdt1FMP6jwdGTYvenDkLz9LrmKrhzkUEvpd0u5iUGRNOfIhJa8i7ilGilyfDuOylL18Itro Zqozfd9V4beUSpOd5t/h33LdCNF3tdNTWLzUbmEZnW9aNf4efulZGQHYqyh1mGAkgaQn7HhRDvpyg EY5sYoLxUz0keefGa6Zx+zEMpwNvCjW+7gIbCu7Gbp6oRam3v45nlrS6Em3IB/V+I533bm4ngKwIp UC6oSwKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYYOK-00000009m40-3mf7; Wed, 02 Dec 2026 00:40:12 +0000 Received: from mail-oi1-x245.google.com ([2607:f8b0:4864:20::245]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYYOD-00000009lte-3ZoD for linux-riscv@lists.infradead.org; Wed, 02 Dec 2026 00:40:08 +0000 Received: by mail-oi1-x245.google.com with SMTP id 5614622812f47-4eb0b989f0eso14991050b6e.0 for ; Tue, 01 Dec 2026 16:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796172004; x=1796776804; darn=lists.infradead.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tTfsOsakO+wxt9FhU+5DDWoTNFu31xlSdrpVDpTjmPw=; b=cISeon3ZjekTxsCsr74jpwkHIraFLaTpmWKgXd6KYGCJKgtMC0a5B88mK369mKnaL6 NojkiD0zm6C+v6ai8KxIseMToiMTHoUNHnP9kv72aHzRTyUWox7MRnkglvsnxyZWr9lr zIrdJ2GJB9Si2Qn8reK2dE4zqGQDHj4N/JjdocL3QaV3n/alhlTc2uwy/iPhTYCCJQwF dkn2VEvcI5SYpOQ2JYwN831N8nxQsXL0glFuDaTb+IXiRSwIMT0DS67nzJuSAS2NuYiQ f4+ZC/RpkrZAox9iUzerPOQx1WdbGUsck2fBx9Hoz6SA3oCm2AqSjBIEStlLx4r4rZgw mLgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796172004; x=1796776804; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tTfsOsakO+wxt9FhU+5DDWoTNFu31xlSdrpVDpTjmPw=; b=EMa9kr1aPKR4NHAhg98qGFwG5McRKCbTnXQ0BdDTtJNZx0v02LPB8fVdgWDy+Z9qtb qUQDR41ZNX+NKOdvLb5R6mABLSuwWMaIy7EKCGKpWS+8PFmMC8bkRSaC8Zm7LBnG6D0d d5EzKJh3fYPtBBmSHIED9Y6CYyGMSbdTEszVFr9OG4MGnJZ2wGTacs81jcqkhMoJfBJo X5GxzaxkT7loyfLkRzr5Rs3tyFokvm19VU0QJ655bFrMCgvcp44JWpsus/V1sYgcFFGv +uD9xCFbYwOfDDb/hgT8Wr+G6uAisImiYUdWz9Vv9hYe+ucRCGHpXbbIXSkkiJDJm4tC XutQ== X-Forwarded-Encrypted: i=1; AL+hErFhb95Dghredp0sTJzRaPPwOvyS0hGaieZ08MVTVl+1NZ1wja+aRo9dV+1LOwvpLauhJqLJ20zEeeuYOw==@lists.infradead.org X-Gm-Message-State: APuU4Z/TG2UwBDRIl46MEnRyHZSzh64CxJu58RZ7rdmlO9M1Jp1Md8DL 5wZhs5f1D/z4Q/d3A16Aj46jS3/BgxNGPEslH072oUCUydo4Xm+Rt2YLca3T4nJdNo1JqtQC4Y3 4RpL5vmrrWMTEVQ== X-Received: from ilbdv24-n1.prod.google.com ([2002:a05:6e02:4018:10b0:510:946:a3d5]) (user=dmatlack job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6808:319a:b0:550:6056:aa66 with SMTP id 5614622812f47-5797bb9fa7emr28565295b6e.16.1796172004115; Tue, 01 Dec 2026 16:40:04 -0800 (PST) Date: Wed, 2 Dec 2026 00:39:42 +0000 In-Reply-To: <20261202003955.3607156-1-dmatlack@google.com> X-Archived-By: Mime-Version: 1.0 References: <20261202003955.3607156-1-dmatlack@google.com> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog Message-ID: <20261202003955.3607156-6-dmatlack@google.com> Subject: [PATCH 05/18] selftests/liveupdate: Build vmtest.sh's binaries with the Makefile From: David Matlack To: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Albert Ou , Alexandre Ghiti , Alex Williamson , Bjorn Helgaas , David Matlack , Jacob Pan , Jason Gunthorpe , Josh Hilke , Lukas Wunner , Mike Rapoport , Palmer Dabbelt , Parav Pandit , Pasha Tatashin , Paul Walmsley , Pranjal Shrivastava , Pratyush Yadav , Samiullah Khawaja , Shuah Khan , Vipin Sharma X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_164005_969043_5600B781 X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -9.5 (---------) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Build the test binary and the init process for vmtest.sh's initrds with the liveupdate selftests Makefile in NOLIBC=1 mode, rather than with separate compiler invocations in vmtest.sh. The build output goes into the workspace. This leaves a single description of how the tests are built, so that any test added to the Makefile can also be run with vmtest.sh, including tests built from multiple source files. Signed-off-by: David Matlack --- tools/testing/selftests/liveupdate/vmtest.sh | 32 ++++++++------------ 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/liveupdate/vmtest.sh b/tools/testing/selftests/liveupdate/vmtest.sh index 6cbee44cd27e..b24a8bb774ca 100755 --- a/tools/testing/selftests/liveupdate/vmtest.sh +++ b/tools/testing/selftests/liveupdate/vmtest.sh @@ -139,29 +139,23 @@ function mkinitrd() { local build_dir=$1 local kernel_path=$2 local test_name=$3 + local make_cmd=$4 + local output="$workspace_dir/build" + local init="$output/init" + local test_binary="$output/$test_name" - # Compile the test binary and the init process - "$CROSS_COMPILE"gcc -static -O2 -nostdinc -nostdlib \ - -I "$headers_dir/include" \ - -I "$kernel_dir/tools/include/nolibc" \ - -I "$test_dir/lib/include" \ - -o "$workspace_dir/test_binary" \ - "$test_dir/$test_name.c" "$test_dir/lib/lu_utils.c" - - "$CROSS_COMPILE"gcc -s -static -Os -nostdinc -nostdlib \ - -fno-asynchronous-unwind-tables -fno-ident \ - -fno-stack-protector \ - -I "$headers_dir/include" \ - -I "$kernel_dir/tools/include/nolibc" \ - -o "$workspace_dir/init" "$test_dir/init.c" + # Build the test binary and the init process + mkdir -p "$output" + $make_cmd -C "$test_dir" NOLIBC=1 OUTPUT="$output" \ + KHDR_INCLUDES="-I$headers_dir/include" "$init" "$test_binary" cat > "$workspace_dir/cpio_list_inner" <