From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796172005; b=OhRGe2op4GUfssqnMjDhA4XLO3/4OV5YocvaKpnaDViBj6Hc3tM/ato2rNAXPzfbADrA ghCUltCRjWU/juFR8M9o4y7GBwS1UwP/5th0PA+E443wYMUi7uQXK3/tQwEa7JxsTj3IO Ft576/Zk0uNA3jpNsyZ6KSAoW1ugDX86z9mOTjvqvnARCPTLlUlyk4vPpKz9n4Pvjm9om d5/nKRa0+ZG5UnyvmRHu64K72bD/pQREJvTGlNeiYhow3IKwTlvdWEYBYnbhfSK3IVP5m FHhFXYG4H74C1aMkfCCQZDVADRLVh8MzEGdDaWZQLu9P/T44sEMzKVOzjMwtJIRk79w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796172005; 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=3myottTLOlL26m+Z0vrkD0NOeL0J8U+Wn7Hk+n9patyViYb8W2hlSoyWmmoVIIcbS7dv lMTgyCpEeK7aRe0rag2FEBO8f2aDQTYoeqyoYc4Ev3wyT4iCOI5Uh38E9+pjByWwx2Wvg BvjW92NSyqwKWL15Lbu8+rWNcXAFGswwp+zG1n6KZDYWksDGbVcWsZiDFlqbW5e2hLYbM c6WaXim3GrDDeSsdRQ3V0f962Hxo4a6EAs9eMI6jt6zYNp2bYnSx/2Smh/Cn+NVLOlx6+ g0jqObxg9ayearYd/e1MmZoSE1YWcEYzr1KQZsxWA2eNQ+a4kp5MR9S9nlTm1wpVMAw== 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.160.72 Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) (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 5C05860A2601 for ; Wed, 2 Dec 2026 00:40:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5C05860A2601 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-oa1-f72.google.com with SMTP id 586e51a60fabf-47cfa971c9eso14977697fac.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=D+NWjeGFg69j3XAluSEf2ZBgnslVxWovAruGgUwi+VwCx4Ymo52xjQ4q2DHNMQKtzT LDmgh6T1UiHK5osOhsF1Ptl7IvXP8uXbCe06EO5sgqxex11/NTQBkB+ACumButlhXUli FGsr0C2DKXUE5xyO+yQFrnN8triV/9HcPxjU+NEEVD7/ASWD0kmqLOhVj7AlrQ1xb0/2 FtpJVjZAT0JaeP2vIqI9eRiE+XKUeHX/jzaLsQ38jQjjpy9C/JiQyg9A3y6eUDMSgFOE RgnPhvzdYafljdqeCBSXDst2kugZ4gBa8wA1EJReOaugVWmNB5kJGq4iEwOtoeKBnvzM So8w== X-Forwarded-Encrypted: i=1; AL+hErFcQcCYQQ5j+o92hUzuj8bgRygc8qKO32iwQZrkV2fGIcXgsk45j6Sj2DrGDugbM0PB1P9bzgRHqOI=@vger.kernel.org X-Gm-Message-State: APuU4Z/chHKuzcMNIAaUScb7x379RUv6Fkpb8V+Fxc0brxui4pXfAQD1 CX49EX9E5XSW34cD1XuitjSbz0KSEdyfUrUmlOXQoEmOAW+VDXSgzGUZ/UFZDvftE8A4i7GI0cU /U3MnGvpeuOxTTQ== 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-pci@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" <