From: Andrew Jones <andrew.jones@linux.dev>
To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
kvmarm@lists.linux.dev
Cc: alexandru.elisei@arm.com, eric.auger@redhat.com,
atishp@rivosinc.com, cleger@rivosinc.com, pbonzini@redhat.com,
thuth@redhat.com, Andrew Jones <ajones@ventanamicro.com>
Subject: [kvm-unit-tests PATCH 2/2] riscv: Introduce MACHINE_OVERRIDE
Date: Fri, 21 Feb 2025 17:27:56 +0100 [thread overview]
Message-ID: <20250221162753.126290-6-andrew.jones@linux.dev> (raw)
In-Reply-To: <20250221162753.126290-4-andrew.jones@linux.dev>
From: Andrew Jones <ajones@ventanamicro.com>
Allow riscv tests to use QEMU machine types other than virt.
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
riscv/run | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/riscv/run b/riscv/run
index 73f2bf54dc32..e2f5a922728c 100755
--- a/riscv/run
+++ b/riscv/run
@@ -10,10 +10,12 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
# Allow user overrides of some config.mak variables
+mach=$MACHINE_OVERRIDE
processor=$PROCESSOR_OVERRIDE
firmware=$FIRMWARE_OVERRIDE
[ "$PROCESSOR" = "$ARCH" ] && PROCESSOR="max"
+: "${mach:=virt}"
: "${processor:=$PROCESSOR}"
: "${firmware:=$FIRMWARE}"
[ "$firmware" ] && firmware="-bios $firmware"
@@ -23,11 +25,11 @@ set_qemu_accelerator || exit $?
acc="-accel $ACCEL$ACCEL_PROPS"
qemu=$(search_qemu_binary) || exit $?
-if ! $qemu -machine '?' | grep -q 'RISC-V VirtIO board'; then
+if [ "$mach" = 'virt' ] && ! $qemu -machine '?' | grep -q 'RISC-V VirtIO board'; then
echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting."
exit 2
fi
-mach='-machine virt'
+mach="-machine $mach"
command="$qemu -nodefaults -nographic -serial mon:stdio"
command+=" $mach $acc $firmware -cpu $processor "
--
2.48.1
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Jones <andrew.jones@linux.dev>
To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
kvmarm@lists.linux.dev
Cc: alexandru.elisei@arm.com, eric.auger@redhat.com,
atishp@rivosinc.com, cleger@rivosinc.com, pbonzini@redhat.com,
thuth@redhat.com, Andrew Jones <ajones@ventanamicro.com>
Subject: [kvm-unit-tests PATCH 2/2] riscv: Introduce MACHINE_OVERRIDE
Date: Fri, 21 Feb 2025 17:27:56 +0100 [thread overview]
Message-ID: <20250221162753.126290-6-andrew.jones@linux.dev> (raw)
In-Reply-To: <20250221162753.126290-4-andrew.jones@linux.dev>
From: Andrew Jones <ajones@ventanamicro.com>
Allow riscv tests to use QEMU machine types other than virt.
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
riscv/run | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/riscv/run b/riscv/run
index 73f2bf54dc32..e2f5a922728c 100755
--- a/riscv/run
+++ b/riscv/run
@@ -10,10 +10,12 @@ if [ -z "$KUT_STANDALONE" ]; then
fi
# Allow user overrides of some config.mak variables
+mach=$MACHINE_OVERRIDE
processor=$PROCESSOR_OVERRIDE
firmware=$FIRMWARE_OVERRIDE
[ "$PROCESSOR" = "$ARCH" ] && PROCESSOR="max"
+: "${mach:=virt}"
: "${processor:=$PROCESSOR}"
: "${firmware:=$FIRMWARE}"
[ "$firmware" ] && firmware="-bios $firmware"
@@ -23,11 +25,11 @@ set_qemu_accelerator || exit $?
acc="-accel $ACCEL$ACCEL_PROPS"
qemu=$(search_qemu_binary) || exit $?
-if ! $qemu -machine '?' | grep -q 'RISC-V VirtIO board'; then
+if [ "$mach" = 'virt' ] && ! $qemu -machine '?' | grep -q 'RISC-V VirtIO board'; then
echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting."
exit 2
fi
-mach='-machine virt'
+mach="-machine $mach"
command="$qemu -nodefaults -nographic -serial mon:stdio"
command+=" $mach $acc $firmware -cpu $processor "
--
2.48.1
next prev parent reply other threads:[~2025-02-21 16:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 16:27 [kvm-unit-tests PATCH 0/2] riscv: Run with other QEMU models Andrew Jones
2025-02-21 16:27 ` Andrew Jones
2025-02-21 16:27 ` [kvm-unit-tests PATCH 1/2] configure: Allow earlycon for all architectures Andrew Jones
2025-02-21 16:27 ` Andrew Jones
2025-03-04 9:12 ` Andrew Jones
2025-03-04 9:12 ` Andrew Jones
2025-02-21 16:27 ` Andrew Jones [this message]
2025-02-21 16:27 ` [kvm-unit-tests PATCH 2/2] riscv: Introduce MACHINE_OVERRIDE Andrew Jones
2025-03-04 9:31 ` [kvm-unit-tests PATCH 0/2] riscv: Run with other QEMU models Andrew Jones
2025-03-04 9:31 ` 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=20250221162753.126290-6-andrew.jones@linux.dev \
--to=andrew.jones@linux.dev \
--cc=ajones@ventanamicro.com \
--cc=alexandru.elisei@arm.com \
--cc=atishp@rivosinc.com \
--cc=cleger@rivosinc.com \
--cc=eric.auger@redhat.com \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.