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 A94AB606A33B for ; Wed, 2 Dec 2026 00:40:14 +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=Wzi7Z0Ky; dkim=pass (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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=tTfsOsakO+wxt9FhU+5DDWoTNFu31xlSdrpVDpTjmPw=; b=Wzi7Z0KykhhvwvyHWILvN8FK6/ 1gBoYPrFQt0hRj2FVlj+2IiO9LQCOm9lvUsYnlDBKYsCPvTocWN/qFUK1LpeXRb+0yWt+l94rhS3z A08DVanJr0NytVdTFYmRzu4mB3KecfStBBUenrgjOcCStCUApWe+Cjg8dpigHvQmzihTp/AjlgX3Y KPp+2fLNXI+d/9PKwWmYGm1ADLufu1jw4JMDmLJqIvHBN6z9I5RcmThd0tX6DpkqGCC2T2COhnzo5 48qVl0+3cmEoB86mPO5kjsOL6qAukE4PJH7K7hGtvWR7d+Iurkg+KwAm0pDuhRjBLgUnRMNvXI4c5 9qRUFB/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYYOM-00000009m5L-0laM; Wed, 02 Dec 2026 00:40:14 +0000 Received: from mail-oi1-x247.google.com ([2607:f8b0:4864:20::247]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYYOD-00000009ltg-2tLK for kexec@lists.infradead.org; Wed, 02 Dec 2026 00:40:08 +0000 Received: by mail-oi1-x247.google.com with SMTP id 5614622812f47-4eb0b989f0eso14991056b6e.0 for ; Tue, 01 Dec 2026 16:40:05 -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=xCCXZIxQS9FOILTwRKIXmaiJSq87BA6HCkXvbEDXb0Cv8sdnEPVeKY1ypJqKk/RzrD ZEK3Eenbqe3k55vCU/28JMTcOtqCN94lsh4pVSrn0qI/zcm3XbKdrG8uh4bwMknQJyvY ZE3mX0cTmgGtZYKv5BtKYKAkpjkOjDZGDSvLR6Oy83IL03wLqiKF/hpmO0Se3gdgOfQs t7oPV2/S7YpUsTPzEKXg5OEPIiddpy8XvIJErgtgFJdxxC7TJHpduLbnkGrohF/l0zXc 1etYtwK8xKeZKAyiJESNss6LOYyO5BOFHh3ZvGhKAfc4DS/LgQtPxatP15diC/AP8FAv yomg== X-Gm-Message-State: APuU4Z/iOW0ryv6d09JMSNRdOisPbFe09MZ+FcGGdu8fer0pi/9Ef+Wk K6Jwdemli/CU6CH8sz7dSiIJdtQjcgvvNkLdW/Gq0yO6rHI4U8mmgOdk0uCN1uehfsMiU+ZgtCB AJm81QLrQ883JCScamNn6YcnfjZUAhQda9VnSs+arPYxg86uwb07GYVKsxxldRWc5GyE9kN6oAn 0q2hxWAfRzhjvlnpbqi0BeT6hw+hT9/3EWcAKziMX0/S325L9/XWY= 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 Content-Type: text/plain; charset="UTF-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_164005_853864_65B3068D X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -9.5 (---------) X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-26.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL 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" <