From 668a08f4950417a59270e56176402cfd0acd858e Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sat, 21 Jan 2023 08:06:41 +0100 Subject: debvm-run: also pass reasonable -cpu for native non-kvm --- bin/debvm-run | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/bin/debvm-run b/bin/debvm-run index 5884551..891cf21 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -218,6 +218,7 @@ set -- \ "$@" QEMU="qemu-system-$VMARCH" +CPU= MACHINE= MAX_SMP= @@ -227,12 +228,17 @@ case "$VMARCH" in MACHINE="type=q35" ;; arm|armel|armhf) + CPU=max MACHINE="type=virt" ;; arm64) QEMU=qemu-system-aarch64 + CPU=max MACHINE="type=virt" ;; + mips64el) + CPU=5KEc + ;; powerpc) QEMU=qemu-system-ppc ;; @@ -253,33 +259,25 @@ if test "$ARCHITECTURE" = "$VMARCH"; then # While kvm will fall back gracefully, the following options can only # be passed when kvm really is available. if test -w /dev/kvm; then - set -- -cpu host "$@" + CPU=host if test "$VMARCH" = arm64; then MACHINE="$MACHINE,gic-version=host" fi fi else case "$VMARCH" in - arm64) - set -- -cpu max "$@" - ;; - arm|armel|armhf) - set -- -cpu max "$@" - ;; - m68k|mipsel|powerpc|sparc64) + m68k|mips64el|mipsel|powerpc|sparc64) MAX_SMP=1 ;; - mips64el) - MAX_SMP=1 - set -- -cpu 5KEc "$@" - ;; esac fi if test -n "$MACHINE"; then set -- -machine "$MACHINE" "$@" fi - +if test -n "$CPU"; then + set -- -cpu "$CPU" "$@" +fi if test -z "$MAX_SMP" || test "$MAX_SMP" -gt 1; then NPROC=$(nproc) test -n "$MAX_SMP" && test "$NPROC" -gt "$MAX_SMP" && NPROC=$MAX_SMP -- cgit v1.2.3