From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
rostedt@goodmis.org, Zhouyi Zhou <zhouzhouyi@gmail.com>,
Joel Fernandes <joelagnelf@nvidia.com>,
"Paul E . McKenney" <paulmck@kernel.org>
Subject: [PATCH v2 4/8] rcutorture: Fix kvm-again.sh re-run failure on ppc64
Date: Wed, 7 Oct 2026 14:04:04 -0700 [thread overview]
Message-ID: <20261007210408.1983713-4-paulmck@kernel.org> (raw)
In-Reply-To: <f9cb7abd-db60-43f6-9392-27fe29abb75b@paulmck-laptop>
From: Zhouyi Zhou <zhouzhouyi@gmail.com>
Discovered in the Open Source Lab of Oregon State University when running
torture.sh on a ppc64le VM. Two bugs were exposed:
1. The kvm-transform.sh call hard-coded "bzImage" as the kernel image
name. On ppc64, the boot image is vmlinux, not bzImage, so the
re-run failed to find the image. Fix this by extracting the QEMU
binary from the qemu-cmd file and passing it to identify_boot_image()
to obtain the correct architecture-specific image name, the same way
kvm.sh already does.
2. The rm -f invocation on re-run listed vmlinux among the files to
delete. On ppc64 vmlinux is the boot image, so deleting it broke
the re-run on that architecture. Drop vmlinux from the unconditional
list, and instead conditionally delete it only when the boot image
basename is not vmlinux.
In addition, identify qemu_binary before the copy step so that on
non-PowerPC systems (where vmlinux is not the boot image) the vmlinux
file can be removed immediately after the run directory is copied,
saving storage before any tests run. This also eliminates the
per-iteration re-computation of qemu_binary and boot_image inside
the qemu-cmd transform loop.
Tested on a local x86_64 machine and on a PPC VM of the Open Source Lab
of Oregon State University.
Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
tools/testing/selftests/rcutorture/bin/kvm-again.sh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-again.sh b/tools/testing/selftests/rcutorture/bin/kvm-again.sh
index b5239b52cb5da..9060b3dc89262 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-again.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-again.sh
@@ -180,6 +180,9 @@ fi
echo ---- Re-run results directory: $rundir
+qemu_binary="$(find "$oldrun" -maxdepth 2 -name 'qemu-cmd' -type f 2>/dev/null | head -1 | xargs -r grep -v '^#' 2>/dev/null | awk 'NF { print $1; exit }')"
+boot_image="`identify_boot_image "$qemu_binary"`"
+
if test "$oldrun" != "$rundir"
then
# Copy old run directory tree over and adjust.
@@ -189,7 +192,7 @@ then
echo "Cannot copy from $oldrun to $rundir."
usage
fi
- rm -f "$rundir"/*/{console.log,console.log.diags,qemu_pid,qemu-pid,qemu-retval,Warnings,kvm-test-1-run.sh.out,kvm-test-1-run-qemu.sh.out,vmlinux} "$rundir"/log
+ rm -f "$rundir"/*/{console.log,console.log.diags,qemu_pid,qemu-pid,qemu-retval,Warnings,kvm-test-1-run.sh.out,kvm-test-1-run-qemu.sh.out} "$rundir"/log
touch "$rundir/log"
echo $scriptname $args | tee -a "$rundir/log"
echo $oldrun > "$rundir/re-run"
@@ -197,6 +200,10 @@ then
then
$arg_link "$oldrun/../../bin" "$rundir/../.."
fi
+ if test "`basename "$boot_image"`" != vmlinux
+ then
+ rm -f "$rundir"/*/vmlinux
+ fi
else
# Check for a run having already happened.
find "$rundir" -name console.log -print > $T/oldrun-console.log
@@ -217,7 +224,7 @@ do
qemu_cmd_dir="`dirname "$i"`"
kernel_dir="`echo $qemu_cmd_dir | sed -e 's/\.[0-9]\+$//'`"
jitter_dir="`dirname "$kernel_dir"`"
- kvm-transform.sh "$kernel_dir/bzImage" "$qemu_cmd_dir/console.log" "$jitter_dir" "$dur" "$bootargs" < $T/qemu-cmd > $i
+ kvm-transform.sh "$kernel_dir/`basename $boot_image`" "$qemu_cmd_dir/console.log" "$jitter_dir" "$dur" "$bootargs" < $T/qemu-cmd > $i
if test -n "$arg_remote"
then
echo "# TORTURE_KCONFIG_GDB_ARG=''" >> $i
--
2.40.1
next prev parent reply other threads:[~2026-10-07 21:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 21:04 [PATCH 0/8] Torture-test updates for v7.4 Paul E. McKenney
2026-10-07 21:04 ` [PATCH v2 1/8] rcutorture: Fix divide-by-zero with fwd_progress_div=1 Paul E. McKenney
2026-10-07 21:04 ` [PATCH v2 2/8] rcutorture: Synchronously wait for all rcu_torture_irq() callbacks to complete Paul E. McKenney
2026-10-07 21:04 ` [PATCH v2 3/8] torture: Allow specifying alternative ssh command to kvm-remote.sh Paul E. McKenney
2026-10-07 21:04 ` Paul E. McKenney [this message]
2026-10-07 21:04 ` [PATCH v2 5/8] rcutorture: Add atomic SRCU lockdep support Paul E. McKenney
2026-10-07 21:04 ` [PATCH v2 6/8] selftests/rcutorture: Wire atomic SRCU into srcu_lockdep.sh Paul E. McKenney
2026-10-07 21:04 ` [PATCH v2 7/8] selftests/rcutorture: Fix double nerrs count in srcu_lockdep.sh Paul E. McKenney
2026-10-07 21:04 ` [PATCH v2 8/8] rcutorture: Add atomic SRCU cross-CPU IRQ context mismatch test Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261007210408.1983713-4-paulmck@kernel.org \
--to=paulmck@kernel.org \
--cc=joelagnelf@nvidia.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=zhouzhouyi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®