Skip to content

Commit

Permalink
[tools] Disable char backend multiplexer in gramine-vm.in
Browse files Browse the repository at this point in the history
Previously, QEMU's stdio was multiplexed on several serial devices: the
QEMU monitor, the `-nographic` device, and virtio-console. For some
reason (wasn't able to root cause), this multiplexer leads to "jumps" in
stdin input when using Gramine's virtio-console implementation. This
behavior is observed on newer QEMU (e.g. v8.2.2) and doesn't appear on
older versions. This may be a subtle bug in QEMU. Regardless, there is
no reason to use the multiplexer, so it is removed.

Also, `-no-hpet` is deprecated in newer QEMU, so this commit uses
`-machine hpet=off` instead.

Signed-off-by: Dmitrii Kuvaiskii <[email protected]>
  • Loading branch information
dimakuv committed Jul 1, 2024
1 parent 486e895 commit 183b6fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/gramine-vm.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ QEMU_CPU_NUM=${QEMU_CPU_NUM:-"1"}
QEMU_PATH="qemu"
QEMU_VM="-cpu host,host-phys-bits,-kvm-steal-time,pmu=off,+tsc-deadline,+invtsc \
-m $QEMU_MEM_SIZE -smp $QEMU_CPU_NUM"
QEMU_OPTS="-enable-kvm -vga none -nographic -no-reboot -monitor chardev:mux -no-hpet \
QEMU_OPTS="-enable-kvm -vga none -display none -no-reboot -monitor none -machine hpet=off \
-object memory-backend-file,id=mem,size=$QEMU_MEM_SIZE,mem-path=/dev/shm,share=on \
-numa node,memdev=mem"

Expand Down Expand Up @@ -150,8 +150,8 @@ if [ $EXIT_STATUS -ne 0 ]; then
fi

QEMU_VIRTIO_CONSOLE="-device virtio-serial,iommu_platform=off,romfile= \
-chardev stdio,id=mux,mux=on \
-device virtconsole,chardev=mux -serial chardev:mux"
-chardev stdio,id=virtioconsole0 \
-device virtconsole,chardev=virtioconsole0"
QEMU_VIRTIO_FS="-chardev socket,path=/tmp/gramine_vhostfs_"$GRAMINE_VM_ID",id=vhostfs \
-device vhost-user-fs-pci,iommu_platform=off,queue-size=1024,chardev=vhostfs,tag=graminefs"
QEMU_VIRTIO_VSOCK="-device vhost-vsock-pci,iommu_platform=off,guest-cid="$GRAMINE_VM_ID",id=vsockdev"
Expand Down

0 comments on commit 183b6fb

Please sign in to comment.