From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Andrew Jones <drjones@redhat.com>
Cc: pbonzini@redhat.com, thuth@redhat.com,
kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH kvm-unit-tests] arch-run: Introduce QEMU_ARCH
Date: Tue, 15 Mar 2022 12:33:17 +0000 [thread overview]
Message-ID: <YjCHcV3iyTtSrw3k@monolith.localdoman> (raw)
In-Reply-To: <20220315080152.224606-1-drjones@redhat.com>
Hi,
On Tue, Mar 15, 2022 at 09:01:52AM +0100, Andrew Jones wrote:
> Add QEMU_ARCH, which allows run scripts to specify which architecture
> of QEMU should be used. This is useful on AArch64 when running with
> KVM and running AArch32 tests. For those tests, we *don't* want to
> select the 'arm' QEMU, as would have been selected, but rather the
> $HOST ('aarch64') QEMU.
>
> To use this new variable, simply ensure it's set prior to calling
> search_qemu_binary().
Looks good, tested on an arm64 machine, with ACCEL set to tcg -
run_tests.sh selects qemu-system-arm; ACCEL unset - run_tests.sh selects
ACCEL=kvm and qemu-system-aarch64; also tested on an x86 machine -
run_tests.sh selects ACCEL=tcg and qemu-system-arm:
Tested-by: Alexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
One thing I noticed is that if the user sets QEMU=qemu-system-arm on an arm64
machine, run_tests.sh still selects ACCEL=kvm which leads to the following
failure:
SKIP selftest-setup (qemu-system-arm: -accel kvm: invalid accelerator kvm)
I'm not sure if this deserves a fix, if the user set the QEMU variable I
believe it is probable that the user is also aware of the ACCEL variable
and the error message does a good job explaining what is wrong. Just in
case, this is what I did to make kvm-unit-tests pick the right accelerator
(copied-and-pasted the find_word function from scripts/runtime.bash):
diff --git a/arm/run b/arm/run
index 94adcddb7399..b0c9613b8d28 100755
--- a/arm/run
+++ b/arm/run
@@ -10,6 +15,10 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
processor="$PROCESSOR"
+if [ -z $ACCEL ] && [ "$HOST" = "aarch64" ] && ! find_word "qemu-system-arm" "$QEMU"; then
+ ACCEL=tcg
+fi
+
Thanks,
Alex
>
> Cc: Alexandru Elisei <alexandru.elisei@arm.com>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
> arm/run | 4 ++++
> scripts/arch-run.bash | 4 +++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arm/run b/arm/run
> index 0629b69a117c..28a0b4ad2729 100755
> --- a/arm/run
> +++ b/arm/run
> @@ -13,6 +13,10 @@ processor="$PROCESSOR"
> ACCEL=$(get_qemu_accelerator) ||
> exit $?
>
> +if [ "$ACCEL" = "kvm" ]; then
> + QEMU_ARCH=$HOST
> +fi
> +
> qemu=$(search_qemu_binary) ||
> exit $?
>
> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
> index aae552321f9b..0dfaf017db0a 100644
> --- a/scripts/arch-run.bash
> +++ b/scripts/arch-run.bash
> @@ -176,8 +176,10 @@ search_qemu_binary ()
> local save_path=$PATH
> local qemucmd qemu
>
> + : "${QEMU_ARCH:=$ARCH_NAME}"
> +
> export PATH=$PATH:/usr/libexec
> - for qemucmd in ${QEMU:-qemu-system-$ARCH_NAME qemu-kvm}; do
> + for qemucmd in ${QEMU:-qemu-system-$QEMU_ARCH qemu-kvm}; do
> if $qemucmd --help 2>/dev/null | grep -q 'QEMU'; then
> qemu="$qemucmd"
> break
> --
> 2.34.1
>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2022-03-15 12:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 8:01 [PATCH kvm-unit-tests] arch-run: Introduce QEMU_ARCH Andrew Jones
2022-03-15 12:33 ` Alexandru Elisei [this message]
2022-03-15 15:16 ` Andrew Jones
2022-03-15 16:31 ` Alexandru Elisei
2022-03-15 17:14 ` Andrew Jones
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=YjCHcV3iyTtSrw3k@monolith.localdoman \
--to=alexandru.elisei@arm.com \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=pbonzini@redhat.com \
--cc=thuth@redhat.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