Skip to content

Commit 11aa3e2

Browse files
committed
Add option for preempt=none
1 parent 2245ba8 commit 11aa3e2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.dev/startvm.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cd $(dirname $0)
44

55
memory=4G
66
cpus=$(nproc)
7+
nopreempt=0
78
network=1
89
fs_type=9pfs
910
no_user_aslr=0
@@ -29,6 +30,7 @@ function show_help () {
2930
echo " --no-user-aslr Disable user-space ASLR (default: no)"
3031
echo " --no-virtio-serial"
3132
echo " Disable virtio-serial and use PCI serial instead (default: no)"
33+
echo " --no-preempt Disable preemption (default: no)"
3234
echo ""
3335
exit 1
3436
}
@@ -70,6 +72,9 @@ while [ "${1:-}" != '' ]; do
7072
--no-virtio-serial )
7173
no_virtio_serial=1
7274
;;
75+
--no-preempt )
76+
nopreempt=1
77+
;;
7378
-h | --help )
7479
show_help
7580
;;
@@ -173,6 +178,11 @@ if [[ $tmux == 1 ]]; then
173178
exec_args="tmux -2 new '$exec_args'"
174179
fi
175180

181+
preempt_cmd=""
182+
if [[ $nopreempt == 1 ]]; then
183+
preempt_cmd="preempt=none"
184+
fi
185+
176186
qemuFlags=(
177187
-machine q35,accel=kvm
178188
-enable-kvm
@@ -182,6 +192,7 @@ qemuFlags=(
182192

183193
-kernel ../vmlinux
184194
-append "\
195+
$preempt_cmd \
185196
$root_cmd \
186197
earlycon $console_cmd \
187198
nokaslr no_hash_pointers loglevel=8 \

0 commit comments

Comments
 (0)