From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.69 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796172005; b=QxAkuFGfjBCufd+h1YNtMZv7Zi9l0EENP+K4vkkpP3ELngQynHuWQUe11RL4el7aO0ot sUpldQqRO8XDU6MH0dN011ipClTPIgP0xYHQHC0UHD45UqvsL39IA1y/zVgz8c1mOqRJ+ p+AlkbKl3AiUkkE4JSVYczzwXx44J+yZFbbDefZ2nuOiBkuXRhY5tgSJoDhzfnsAR059S PHZ2/pKtqwxODuWbZYZZvgAvLMetpPMrNu8bHPVJh6vexCifLJX1OxU6WE4pFEynzIcbu p3ey2B8wBd4PPa442FkjALeDysqEIS8+UR3mvWRxnXEYMCuSz66mocQ8kuY7o8TjNrg== 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=HQzONZOap4CBI8CqFMolKHFokxU3k+NuP7n5i2nLVLv1DTmNUFpa1UpefVOTYW+QoGFE 0BLozcmPLJJbGfePByWjSqU9mxlQ//3aFhxsD/SJ2s83/NBFR0JD2zLDsUK/FVU7SG5/M xdxqMQqKAILOyjvi2NruFWcp0THsoYWa7HDMPnaPbkH9Ra2zHmsQLUuu2R+9pdnEMfJiI v3UwiZnFMzFZVagaB2eFRoekBnozKoTVmsaJHHcYV2iw/FYy3wGgFPpOgXZh6+0cFFg9y 4LUEpJoqG2QUqiuNlr1q/DOYjqV1OlXLs0+krtAlDwX4NoEkwtmDqok5TCqPCK9liTA== 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.69 Received: from mail-oa1-f69.google.com (mail-oa1-f69.google.com [209.85.160.69]) (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 47B4F606A33E for ; Wed, 2 Dec 2026 00:40:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 47B4F606A33E 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-f69.google.com with SMTP id 586e51a60fabf-4ab90cdf747so15460733fac.1 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=idGhwJK5wH9eysZmJ7WUamULjqPVhgVqnflUvYxZEQxp1o+8sUlbTDJLrw9jgR6ZaI WlZiuoxGomCHfYg1xFCl0L0hbXMyBP84IqIZq7H299HrMcbgvTudyT54zfDUm7Likc9j hrQCVJZG42ZlV2AVnXAJ/wCXTv1mEjVcqVjWo9MrXsFdLOePEvx8rcAgu/OBJzb6afZO WqzKaAucFVWg9Axm1JLBFYjEpaQwAqLcFkycuBDaiDyESwoF0s3D3g1pzzWK6ULIRPnu TlaNwU2QL85sbmNs4Si2XP2rKillru2gaoWmWBuT9dKFt7uLEfU2u9zV6B/ZTrn8VTDS 77cw== X-Forwarded-Encrypted: i=1; AL+hErHtzHM5iyX4nB5az98UMrFIggql1zSYO1mbJYkusYVTTBRGdQ67JZVSFigptvz3FhaK6g8AAjza3lNYZ3QIOFU=@vger.kernel.org X-Gm-Message-State: APuU4Z+GctgREh9K0+bxayz5B3L90MqWhW/2KumScLPL2YJOPnOI6KSQ L2uKp+0s5UUVNZ9g5ekPVkLm/dUrBOaeN9807De3y7XvF/4Ne/ZLLRj51EP6qIAAoP45C88jKNY lsGmG84fmeS/Jdg== 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-kselftest@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" <