Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Optional parameters:
This can be useful for reproducing certain bugs but booting kernels
will be much slower.

-s | --smp:
By default, the script does not specify a number of cores for the
QEMU machine, which usually means it spawns with only one core.
Certain features such as the KCSAN KUnit tests require multiple cores
to work so this value will be used for the number of cores for the
virtual machine. It can be more than the number of processors on your
host machine.

-t | --timeout:
By default, the timeout command waits 3 minutes before killing the
QEMU machine. Depending on the power of the host machine, this might
Expand Down
11 changes: 9 additions & 2 deletions boot-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ function parse_parameters() {
KVM=false
;;

-s | --smp)
shift && SMP=${1}
;;

-t | --timeout)
shift && TIMEOUT=${1}
;;
Expand Down Expand Up @@ -187,7 +191,7 @@ function setup_qemu_args() {
if ${DEBIAN}; then
# Booting is so slow without these
QEMU_RAM=2G
QEMU_ARCH_ARGS+=(-smp 4)
QEMU_ARCH_ARGS+=(-smp "${SMP:-4}")
fi
QEMU=(qemu-system-aarch64)
;;
Expand Down Expand Up @@ -277,7 +281,7 @@ function setup_qemu_args() {
-cpu host
-d "unimp,guest_errors"
-enable-kvm
-smp "$(nproc)"
-smp "${SMP:-$(nproc)}"
)
else
QEMU_ARCH_ARGS=(-cpu Nehalem)
Expand Down Expand Up @@ -342,6 +346,9 @@ function invoke_qemu() {
fi
# Removing trailing space for aesthetic purposes
[[ -n ${APPEND_STRING} ]] && QEMU+=(-append "${APPEND_STRING%* }")
if [[ -n ${SMP} ]] && ! echo "${QEMU_ARCH_ARGS[*]}" | grep -q "smp"; then
QEMU+=(-smp "${SMP}")
fi
if ${GDB:=false}; then
while true; do
if lsof -i:1234 &>/dev/null; then
Expand Down