diff options
author | Gunnar Beutner <gunnar@beutner.name> | 2021-08-04 01:39:14 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-04 21:15:41 +0200 |
commit | 723c89af670c3574374f4c1800ba072267a3d1eb (patch) | |
tree | 8d1d879f37fccbc50403b8e25804e565047382a3 /Meta/run.sh | |
parent | 5445155dba87b0529c3f1b206015e12f6f3a5e06 (diff) | |
download | serenity-723c89af670c3574374f4c1800ba072267a3d1eb.zip |
Meta: Automatically enable WHPX when possible
Diffstat (limited to 'Meta/run.sh')
-rwxr-xr-x | Meta/run.sh | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/Meta/run.sh b/Meta/run.sh index a2ba475a35..38a7f5a08d 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -60,16 +60,6 @@ fi [ -z "$SERENITY_RAM_SIZE" ] && SERENITY_RAM_SIZE=512M -if command -v wslpath >/dev/null; then - case "$SERENITY_QEMU_BIN" in - /mnt/?/*) - [ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max,vmx=off" - SERENITY_KERNEL_CMDLINE="$SERENITY_KERNEL_CMDLINE disable_virtio" - esac -fi - -[ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max" - [ -z "$SERENITY_DISK_IMAGE" ] && { if [ "$SERENITY_RUN" = qgrub ]; then SERENITY_DISK_IMAGE="grub_disk_image" @@ -100,6 +90,23 @@ if [ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_VERSION" ]; then die fi +if command -v wslpath >/dev/null; then + case "$SERENITY_QEMU_BIN" in + /mnt/?/*) + if [ -z "$SERENITY_VIRT_TECH_ARG" ]; then + if [ "$installed_major_version" -gt 5 ]; then + SERENITY_VIRT_TECH_ARG="-accel whpx,kernel-irqchip=off -accel tcg" + else + SERENITY_VIRT_TECH_ARG="-accel whpx -accel tcg" + fi + fi + [ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max,vmx=off" + SERENITY_KERNEL_CMDLINE="$SERENITY_KERNEL_CMDLINE disable_virtio" + esac +fi + +[ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max" + if [ -z "$SERENITY_SPICE" ] && "${SERENITY_QEMU_BIN}" -chardev help | grep -iq qemu-vdagent; then SERENITY_SPICE_SERVER_CHARDEV="-chardev qemu-vdagent,clipboard=on,mouse=off,id=vdagent,name=vdagent" elif "${SERENITY_QEMU_BIN}" -chardev help | grep -iq spicevmc; then |