[kvm-unit-tests PATCH v6 12/14] arm64: add EL2 environment variable

Joey Gouly joey.gouly at arm.com
Fri Jan 23 08:50:51 PST 2026


This variable when set to y/Y/1 will cause QEMU/kvmtool to start at EL2.

Signed-off-by: Joey Gouly <joey.gouly at arm.com>
Acked-by: Marc Zyngier <maz at kernel.org>
Reviewed-by: Eric Auger <eric.auger at redhat.com>
---
 arm/run               | 9 +++++++++
 scripts/arch-run.bash | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/arm/run b/arm/run
index 858333fc..2d5ee672 100755
--- a/arm/run
+++ b/arm/run
@@ -59,6 +59,10 @@ function arch_run_qemu()
 		M+=",highmem=off"
 	fi
 
+	if is_enabled "$EL2"; then
+		M+=",virtualization=on"
+	fi
+
 	if ! $qemu $M -device '?' | grep -q virtconsole; then
 		echo "$qemu doesn't support virtio-console for chr-testdev. Exiting."
 		exit 2
@@ -116,6 +120,11 @@ function arch_run_kvmtool()
 	fi
 
 	command="$(timeout_cmd) $kvmtool run"
+
+	if is_enabled "$EL2"; then
+		command+=" --nested"
+	fi
+
 	if [ "$HOST" = "aarch64" ] && [ "$ARCH" = "arm" ]; then
 		run_test_status $command --kernel "$@" --aarch32
 	else
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 16417a1e..01cc1ff2 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -596,3 +596,8 @@ set_qemu_accelerator ()
 
 	return 0
 }
+
+is_enabled ()
+{
+	[[ "$1" == 1 ]] || [[ "$1" == Y ]] || [[ "$1" == y ]]
+}
-- 
2.25.1




More information about the linux-arm-kernel mailing list