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
7 changes: 7 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ Optional parameters:
shell. When this is set, there is no timeout so any value supplied
via the script's -t option is ignored.

--no-kvm:
By default, the script passes '-enable-kvm' to QEMU for hardware
virtualization support if the host machine supports it. The option
prevents that, causing QEMU to fallback to software virtualization.
This can be useful for reproducing certain bugs but booting kernels
will be much slower.

-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
9 changes: 7 additions & 2 deletions boot-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ function parse_parameters() {
shift && KERNEL_LOCATION=${1}
;;

--no-kvm)
KVM=false
;;

-t | --timeout)
shift && TIMEOUT=${1}
;;
Expand All @@ -98,6 +102,7 @@ function sanity_check() {
# Some default values
[[ -z ${DEBIAN} ]] && DEBIAN=false
[[ -z ${INTERACTIVE} ]] && INTERACTIVE=false
[[ -z ${KVM} ]] && KVM=true

# KERNEL_LOCATION could be a relative path; turn it into an absolute one with readlink
KERNEL_LOCATION=$(readlink -f "${KERNEL_LOCATION}")
Expand Down Expand Up @@ -174,7 +179,7 @@ function setup_qemu_args() {
-cpu max
-machine "virt,gic-version=max"
)
if [[ "$(uname -m)" = "aarch64" && -e /dev/kvm ]]; then
if [[ "$(uname -m)" = "aarch64" && -e /dev/kvm ]] && ${KVM}; then
QEMU_ARCH_ARGS+=(-enable-kvm)
else
QEMU_ARCH_ARGS+=(-machine "virtualization=true")
Expand Down Expand Up @@ -267,7 +272,7 @@ function setup_qemu_args() {
KIMAGE=bzImage
APPEND_STRING+="console=ttyS0 earlycon=uart8250,io,0x3f8 "
# Use KVM if the processor supports it and the KVM module is loaded (i.e. /dev/kvm exists)
if [[ $(grep -c -E 'vmx|svm' /proc/cpuinfo) -gt 0 && -e /dev/kvm ]]; then
if [[ $(grep -c -E 'vmx|svm' /proc/cpuinfo) -gt 0 && -e /dev/kvm ]] && ${KVM}; then
QEMU_ARCH_ARGS=(
-cpu host
-d "unimp,guest_errors"
Expand Down