mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] rcutorture: kvm-again.sh: Fix re-run failure on ppc64
@ 2026-09-15  8:59 Zhouyi Zhou
  2026-09-16  0:12 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Zhouyi Zhou @ 2026-09-15  8:59 UTC (permalink / raw)
  To: paulmck, rcu, linux-kernel, lance; +Cc: Zhouyi Zhou

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 list.

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>
---
Changes in v2:
 - Remove blank line between qemu_binary and boot_image assignments
   for cleaner style.

 tools/testing/selftests/rcutorture/bin/kvm-again.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/kvm-again.sh b/tools/testing/selftests/rcutorture/bin/kvm-again.sh
index b5239b52cb5d..cacc9f2b230d 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-again.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-again.sh
@@ -189,7 +189,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"
@@ -217,7 +217,10 @@ 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
+	qemu_binary="`grep -v '^#' $T/qemu-cmd | awk 'NF { print $1; exit }'`"
+	boot_image="`identify_boot_image "$qemu_binary"`"
+	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.43.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] rcutorture: kvm-again.sh: Fix re-run failure on ppc64
  2026-09-15  8:59 [PATCH v2] rcutorture: kvm-again.sh: Fix re-run failure on ppc64 Zhouyi Zhou
@ 2026-09-16  0:12 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2026-09-16  0:12 UTC (permalink / raw)
  To: Zhouyi Zhou; +Cc: rcu, linux-kernel, lance

On Tue, Sep 15, 2026 at 08:59:49AM +0000, Zhouyi Zhou wrote:
> 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 list.
> 
> 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>

Good catch!!!

One additional request below.

> ---
> Changes in v2:
>  - Remove blank line between qemu_binary and boot_image assignments
>    for cleaner style.
> 
>  tools/testing/selftests/rcutorture/bin/kvm-again.sh | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm-again.sh b/tools/testing/selftests/rcutorture/bin/kvm-again.sh
> index b5239b52cb5d..cacc9f2b230d 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm-again.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm-again.sh
> @@ -189,7 +189,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"
> @@ -217,7 +217,10 @@ 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
> +	qemu_binary="`grep -v '^#' $T/qemu-cmd | awk 'NF { print $1; exit }'`"

Would it be possible to identify qemu_binary earlier so that if the
binary is not vmlinux, vmlinux can be removed?  This saves quite a bit
of storage for non-PowerPC systems.

							Thanx, Paul

> +	boot_image="`identify_boot_image "$qemu_binary"`"
> +	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.43.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-16  0:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15  8:59 [PATCH v2] rcutorture: kvm-again.sh: Fix re-run failure on ppc64 Zhouyi Zhou
2026-09-16  0:12 ` Paul E. McKenney

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®