From 51d39f686f2927a1f9fe66fa9b77f6fbe9975935 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Thu, 14 May 2020 11:35:31 -0700 Subject: [PATCH 1/2] enable more virtual cores for x86 The unit tests enabled via CONFIG_KCSAN_TEST require >1 CPU to run. Enable more cpu's via QEMU's `-smp ` command line flag. Not sure if we should just do this for all ARCHs and if we should use a value like 8 or min(nproc, 8). Signed-off-by: Nick Desaulniers --- boot-qemu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot-qemu.sh b/boot-qemu.sh index 06c6e96..1e69a3b 100755 --- a/boot-qemu.sh +++ b/boot-qemu.sh @@ -191,7 +191,7 @@ function setup_qemu_args() { APPEND_STRING+="console=ttyS0 " # Use KVM if the processor supports it (first part) and the KVM module is loaded (second part) [[ $(grep -c -E 'vmx|svm' /proc/cpuinfo) -gt 0 && $(lsmod 2>/dev/null | grep -c kvm) -gt 0 ]] && - QEMU_ARCH_ARGS=("${QEMU_ARCH_ARGS[@]}" -cpu host -d "unimp,guest_errors" -enable-kvm) + QEMU_ARCH_ARGS=("${QEMU_ARCH_ARGS[@]}" -cpu host -d "unimp,guest_errors" -enable-kvm -smp $(nproc)) case ${ARCH} in x86) QEMU=(qemu-system-i386) ;; x86_64) QEMU=(qemu-system-x86_64) ;; From 0cade4a0ccf1092d4d13392e7402ef9f920ab35f Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Thu, 14 May 2020 11:42:04 -0700 Subject: [PATCH 2/2] add some quotes for shellcheck --- boot-qemu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot-qemu.sh b/boot-qemu.sh index 1e69a3b..30752f4 100755 --- a/boot-qemu.sh +++ b/boot-qemu.sh @@ -191,7 +191,7 @@ function setup_qemu_args() { APPEND_STRING+="console=ttyS0 " # Use KVM if the processor supports it (first part) and the KVM module is loaded (second part) [[ $(grep -c -E 'vmx|svm' /proc/cpuinfo) -gt 0 && $(lsmod 2>/dev/null | grep -c kvm) -gt 0 ]] && - QEMU_ARCH_ARGS=("${QEMU_ARCH_ARGS[@]}" -cpu host -d "unimp,guest_errors" -enable-kvm -smp $(nproc)) + QEMU_ARCH_ARGS=("${QEMU_ARCH_ARGS[@]}" -cpu host -d "unimp,guest_errors" -enable-kvm -smp "$(nproc)") case ${ARCH} in x86) QEMU=(qemu-system-i386) ;; x86_64) QEMU=(qemu-system-x86_64) ;;