From cd2e4ed389df6d6dabaa530ee5280be8beabe293 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 25 Jan 2023 12:39:54 +0100 Subject: debvm-run: disable kvm for armhf -> arm64 when the cpu cannot run it Reported-by: Arnd Bergmann --- bin/debvm-run | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bin') diff --git a/bin/debvm-run b/bin/debvm-run index 0e9403f..0d2ee95 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -292,7 +292,19 @@ case "$KERNELARCH" in ;; esac +ENABLE_KVM=no if test "$ARCHITECTURE" = "$KERNELARCH"; then + ENABLE_KVM=yes + case "$VMARCH:$KERNELARCH" in + arm:arm64|armel:arm64|armhf:arm64) + if ! linux32 true >/dev/null 2>&1; then + # This arm64 cannot run 32bit arm, so don't try KVM. + ENABLE_KVM=no + fi + ;; + esac +fi +if test "$ENABLE_KVM" = yes; then if ! command -v "$QEMU" >/dev/null 2>&1; then # Fall back to kvm in case we badly guessed qemu. QEMU=kvm -- cgit v1.2.3