From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796172006; b=BlnXyBdhi02wtmfYpCwL4Qa6Yu0QtXs/g3im6uvvM0dZT91ZNewZD+q/THUJ/XsLs64Q GfwOVWDwhLCYxQ1dsn8J6fMFS8LV5d8EI/NzqkHF+Yji6U1SW4yQAP+8hL95Xvh9dpjCd bowTA5/9637NY4Bp6PUBBZ2CzGFMIH6LjMsTs9HOP5i3UtD4pz8/ct+Y1dYN6RZpmM7WJ o/BrmzAOZ6NbhstL5UUsK9SjFVjd3r1AxHoLtRQY56u9WPsQ8dBR6jt3GOYQI/obmtK7q p+sfUC6tyQh9QtTPZyiYWsrAQN9shEX34KNAj73hq5q/hNn75F24Fey63jvxxtd/gWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796172006; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=tTfsOsakO+wxt9FhU+5DDWoTNFu31xlSdrpVDpTjmPw=; b=fOb/eHc3K51K+TYyic8HImRiRWD5x6g8kvaA2JztBsy08cr9aI504UjluOuvc/Qv7ZnR SyvXUBadCAp+8zkCSJ5ASt4Wqs43lWP4nKixzQEDLLj1e9bsJ6dWHZceR0GP8cq4m1Alr 1Qtuvn+1C3KdmU/dQg5AHnx/UCvPmBAt6r6xJ9wAadeeVQFpZFDOCKXuL0O38utq6uve4 anQXjVkYtWhd5+fqvILFx+TtYAmtsE6bEpAUY/oGH5r6i18qLo5wtghPzs+OxxFjkFE/4 ioQyu2J0RztenzQ9VDHGFgqg5r7AwuRw0uEyMRw+FenVRMjWhDUHWd+e0MJqYS1aTbA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=Yg1DJTvw; arc=none smtp.remote-ip=209.85.167.197 Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B09A606A6B1 for ; Wed, 2 Dec 2026 00:40:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4B09A606A6B1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=Yg1DJTvw Received: by mail-oi1-f197.google.com with SMTP id 5614622812f47-4eb0b989f0eso14991054b6e.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=vger.kernel.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=Yg1DJTvwmJ/zmPkvxT4w+4Pg/MpId/1KkBPBeMecS/CbJWL9ObEHZVNjSak6pYFrH2 Y/ODzCAmYZuUwQn5bqpzI4aZZ2dTWwC5dLo+hdxVi1cnmxx0RgJFO51WRTqhH6K6EXiI Ppo64Usc4imhtjtUC4IaGcgloV1irWBMZYzr2xoKl+I6ra03xuCO0ipx/vnhNUZFVIVU UbfDPgBjY0KATqGb+isXeQn5PDSh3a4e+IzzYLmVDnLA9xlfSXISE9I6ocFLVp7dR4Cb jyIf00j0WIO1JO00n2W1mGrI1RKN9Z1GGVR8XrPXHunwIaXJzLQkuw2kjUAHc41p4ueG wTOw== 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=Ikxt3RN2xHmsAhfGlopNVodC5BO6BjHpsuS+362ojzMAV2iPQyRHytS/+1TJXkg/pd PZqnZlB6DE4uuibjZqxGKDRjZ04FDpfya9NmOaepE9nsOFD1tG5kJWIAxLXN3BviKEfD 1trsdiiMQpkQNldpzgjPi1b5YRTKSXTCDtcJ5Oz9tXNrmdy1NsruL8oqS2QH+73i+6DP N5re28vrZq2GijbbIZM5SzSUROUBD9zuDHePT8+k/1pB/JUmV8Eyd8xDa9KSZzg0F5Sa dIbSbHhmOM65p1+nesUpWYBovu2laS+Nq3S16hsMEViZe/cLhh1ptbxrLFjmyHdVAIRH H+Gg== X-Forwarded-Encrypted: i=1; AL+hErFsDNCCnyAoYMRgwVqJyshRUe8CUCGoIGsu+U8uEVdfm6R3NVzNPeVMizBKPHFXKcMSRD1MpnzZqK7m4rw=@vger.kernel.org X-Gm-Message-State: APuU4Z9s7kmagUHTi0aNhQh7U+t1vbyB7y+gQhGvTFProgxvz/7Ys4lj v+3GgFAeZ3SrPYCFAg05kUppfNaHCcvpPRlaZIzi/R2lA+ZMkfGaz+OVNZRhB9WLu5WK7mcfYRi fMrdhSBEWfBGwrg== 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-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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" 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" <