From 183b6fb0e190ede43866142608eddb7cc8e81947 Mon Sep 17 00:00:00 2001 From: Dmitrii Kuvaiskii Date: Mon, 1 Jul 2024 07:12:59 -0700 Subject: [PATCH] [tools] Disable char backend multiplexer in `gramine-vm.in` 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 --- tools/gramine-vm.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/gramine-vm.in b/tools/gramine-vm.in index 4c657fbe7..2ca1a0ea3 100755 --- a/tools/gramine-vm.in +++ b/tools/gramine-vm.in @@ -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" @@ -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"