From a97df50696100e9f398b2df35183532ba1274631 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 15 Sep 2020 17:39:35 -0400 Subject: [PATCH] qemu_template: use more cpus for ARM if available But don't hog all `VM_NCPUS`, as we are still emulating them Signed-off-by: Vincent Batts --- build_library/qemu_template.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build_library/qemu_template.sh b/build_library/qemu_template.sh index bf840a0ea5..c2e01045f3 100755 --- a/build_library/qemu_template.sh +++ b/build_library/qemu_template.sh @@ -158,7 +158,12 @@ else arm64-usr+aarch64) set -- -machine virt,accel=kvm,gic-version=3 -cpu host -smp "${VM_NCPUS}" -nographic "$@" ;; arm64-usr+*) - set -- -machine virt -cpu cortex-a57 -smp 1 -nographic "$@" ;; + if test "${VM_NCPUS}" -gt 4 ; then + VM_NCPUS=4 + elif test "${VM_NCPUS}" -gt 2 ; then + VM_NCPUS=2 + fi + set -- -machine virt -cpu cortex-a57 -smp "${VM_NCPUS}" -nographic "$@" ;; *) die "Unsupported arch" ;; esac