From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f73.google.com (mail-dl1-f73.google.com [74.125.82.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E089F331A41 for ; Thu, 5 Feb 2026 22:11:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770329494; cv=none; b=Ak49nK0ZTRNP8R9yWYER5f4dUkW7Eo7sk6xXMf0XkwnuAF+MOSMDXVX83D56pZSwxELQBJB+uuDIyVQ/YzC/H5yr6Vdsxo7UDpzMyqpscL7MjtVmJlSpyEakLR+DJGa997Ahjx8V1f2xLYhfheA/D5ADukIhr0oep4tHjFeby8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770329494; c=relaxed/simple; bh=YI7OuwfXOaydBTv/Q9XXmhgvbOs2VgItUWWh7YHkZH8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=AwnajT16k2hg1oAvQmj2OI8DFupFJdrPDOErATtiaQprSHxfwO+FsHAHd+AOR2KqYDqTFm86aXxEdD9Z3qDXLRJ2UB3MoY4g47ZWY7UoxBBbBzGdPu6BWTiFBIcnWPCtt7gqyu3rjUGg6WyOU4vAJLeiiOPaPidsGwIBS8BDBH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jordanrichards.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Jtm40tt0; arc=none smtp.client-ip=74.125.82.73 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--jordanrichards.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Jtm40tt0" Received: by mail-dl1-f73.google.com with SMTP id a92af1059eb24-124627fc58dso2857956c88.1 for ; Thu, 05 Feb 2026 14:11:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770329493; x=1770934293; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Z9eDseQYzgKZYQrXhIi7NMMbxjrrJgwLrfu5M307gzg=; b=Jtm40tt0o4Ne3KVIo3HmqAQLD4VQfC7R4N+0xPS+6BlxGkx2LgejGl2o59iklkotN+ vpQyRa0f5cT6o/C41LhjVtifXD1DX//o7YubLtxMknylTPrFRJkodepA2C9Q/Mre8xYI 96lU06kGLhS6aLBSMP1569cgHtq6yXjvBaHNVUg32Acrge/9S+xQwF5ZlyaL295wEyoH A+w1C3gDauXWl7SC01XHD1//2sh7QqgbgxihQ7vj0BdFJLt5ciWXwYP162trAn0QY1A+ 9modXuIO7uSM9rzSE9YTuI7uyVGsU+DJn0kpqeYS4TLuwdJKRVzfHGCmSuJ2EvCw0/Q7 IBIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770329493; x=1770934293; h=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; bh=Z9eDseQYzgKZYQrXhIi7NMMbxjrrJgwLrfu5M307gzg=; b=FM7hqZzQFuO0fHvnD0pbW+3JdROUxZrBMzo2B59vLX5VRd0qpa6i+ZEEdjThdPuOs2 EafvVPipNqhqWRStl3kOzICxWVsbx71wlFGK67t4gUamYSk9o26xFQJqbNFBtvAURqQC U/IiBbpVcQUdfYBxhAw0ZZYCjRtLFZSPx68mRh9guBGABSUNXhxbRsvW/zIy+ea01747 uSoWE0KlMZ7io1x5hakMqv6t5/N1EKHThLyg65iGHS+IZCcjQWVL6UrjJTqibO5e1cWs 8YDmRfZOMK+CAPrEJQFWcJirN/5kP3cJee3tv04dm0exyKu8OVf0JO+vVVIxZuD02oIW LqMQ== X-Forwarded-Encrypted: i=1; AJvYcCUext7mVLNdouxU4DabNk0SbE9RF7ovkoIac4up+oBkfZBnHHR+YsXUDaUG3vHd8hHgce1Ix6K2qRYbC5w=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9nQ3kWqFDeNGAUhwSRVfoT98ehAlhcxbusZAwfnn4jHyT1MMI 1JWM7HH+scsYqo0A7k8YQqQNGLb+8KvuJSHiY2dZ9fQ74uAM61UAEbCJFcG9UZAL9Ps0nghdYsn vk+Xbgnx2AxMBZWJoTJoRyfYlQPq6A0egmjrn/A== X-Received: from dybir8.prod.google.com ([2002:a05:7300:c8c8:b0:2b7:4f7a:4d75]) (user=jordanrichards job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:fb8b:b0:2ab:ca55:b760 with SMTP id 5a478bee46e88-2b856a5bd04mr250824eec.43.1770329492914; Thu, 05 Feb 2026 14:11:32 -0800 (PST) Date: Thu, 5 Feb 2026 22:11:22 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.53.0.rc2.204.g2597b5adb4-goog Message-ID: <20260205221122.2415333-1-jordanrichards@google.com> Subject: Re: [PATCH] selftests/liveupdate: add end to end test infrastructure and scripts From: Jordan Richards To: rppt@kernel.org Cc: dmatlack@google.com, jasonmiu@google.com, jordanrichards@google.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, pasha.tatashin@soleen.com, pratyush@kernel.org, shuah@kernel.org Content-Type: text/plain; charset="UTF-8" Sending v2 addressing this feedback soon: >> + err = kexec_file_load(kernel_fd, initrd_fd, strlen(cmdline) + 1, >> + cmdline, 0); >> + >> + close(initrd_fd); >> + close(kernel_fd); >> + >> + return err ? : 0; > > Just return err? Good point, fixed. >> diff --git a/tools/testing/selftests/liveupdate/luo_test.sh b/tools/testing/selftests/liveupdate/luo_test.sh >> new file mode 100755 >> index 000000000000..90ecb16e87bb >> --- /dev/null >> +++ b/tools/testing/selftests/liveupdate/luo_test.sh > >... > >> +function detect_cross_compile() { >> + local target=$1 >> + local host=$(uname -m) >> + > > This function works fine if you run luo_test.sh directly or have cross > compilers named the way it expects in $PATH. > > But if I run > CROSS_COMPILE=~/cross/gcc-13.2.0-nolibc/aarch64-linux/bin/aarch64-linux- ./run.sh > on x86, x86 tests fail > >> + if [ -n "$CROSS_COMPILE" ]; then >> + return >> + fi >> + >> + [[ "$host" == "arm64" ]] && host="aarch64" >> + [[ "$target" == "arm64" ]] && target="aarch64" >> + >> + if [[ "$host" == "$target" ]]; then >> + CROSS_COMPILE="" >> + return >> + fi The host==target test needed to be first, fixed. >> + local fragments=() >> + >> + if [[ -f "$common_conf" ]]; then >> + fragments+=("$common_conf") >> + fi >> + >> + if [[ -f "$arch_conf" ]]; then >> + fragments+=("$arch_conf") >> + fi > > I think the common and arch config fragments are required and we can just > assign fragments directly and run merge_config.sh. Done. I wasn't sure if arch_conf would be necessary for all architectures, but it is kind of needless complexity. > + if [[ "$qemu_cmd" == *"$host_machine"* ]]; then > + if [ -w /dev/kvm ]; then > + accel="-accel kvm" > + fi > + fi > > Do we care that much about qemu warnings about invalid accelerator to have > this logic here? > > -accel kvm -accel hvf -accel tcg > > seems to cover all bases. The warning doesn't break the tests, so it should be fine. >> +#include > > This breaks running normal make: > > luo_test_utils.c:16:10: fatal error: sys.h: No such file or directory > 16 | #include > | ^~~~~~~ > > NOLIBC specific includes and calls should be guarded with #ifdef NOLIBC Done. > diff --git a/tools/testing/selftests/liveupdate/run.sh b/tools/testing/selftests/liveupdate/run.sh > new file mode 100755 > index 000000000000..3f6b29a26648 > --- /dev/null > +++ b/tools/testing/selftests/liveupdate/run.sh > @@ -0,0 +1,68 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > + >> +OUTPUT_DIR="results_$(date +%Y%m%d_%H%M%S)" > > I don't think that putting the results in the current directory rather than > in SCRIPT_DIR or in an explicitly named directory is a good idea. Changed to "$SCRIPT_DIR/results_*". >> +TEST_NAMES=() >> +while IFS= read -r file; do >> + TEST_NAMES+=("$(basename "$file" .c)") >> +done < <(find "$SCRIPT_DIR" -maxdepth 1 -name "luo_*.c" ! -name "luo_test_utils.c") > > I don't like name based detection of tests. Listing them explicitly seems a viable option. Agreed, changed to a fixed array.