vhost-user-gpu: process fails and no display output on Loongarch64

Summary

I am attempting to test vhost-user-gpu on Loongarch64. There is a failure when using vhost-user-gpu with QEMU on Loongarch64 architecture. The GPU device does not initialize correctly, and both the host and guest show error messages related to the vhost-user protocol and device configuration. No display output is available in the guest from boot (not even grub), and the vhost-user-gpu process closes unexpectedly.

Host environment

  • Operating system: Debian 14.2.0-19
  • OS/kernel version: 6.15.2
  • Architecture: loongarch64
  • QEMU flavor: qemu-system-loongarch64
  • QEMU version: 10.0.50
  • QEMU command line:
    ./vhost-user-gpu -s /tmp/vhost-user-gpu.sock -v
    
    ./qemu-system-loongarch64 -m 4G -smp 4 -cpu la464 \
     -object memory-backend-memfd,share=on,id=mem0,size=4G \
     -machine virt,kernel_irqchip=on,memory-backend=mem0 \
     -accel kvm \
     -bios /usr/share/edk2/loongarch64/QEMU_EFI.fd \
     -serial stdio \
     -display gtk,gl=on \
     -vga none \
     -chardev socket,id=vgpu,path=/tmp/vhost-user-gpu.sock \
     -device vhost-user-gpu-pci,chardev=vgpu \
     -drive file=/home/debian/image/debianqemu.qcow2,format=qcow2,id=hd0 \
    

Emulated/Virtualized environment

  • Operating system: Debian 14.2.0-19
  • OS/kernel version: 6.14.0-rc5
  • Architecture: loongarch64

Description of problem

I compiled QEMU and enabled kvm, virglrenderer, gtk and vhost_user.I used vhost-user-gpu as follows:

  • start vhost-user-gpu process
  • start QEMU guest

Process vhost-user-gpu start successfully, after starting QEMU, no display output appears in the guest, indluding during boot and grub.When starting the guest kernel(debug via serial output) ,the vhost-user-gpu process exits with an error:

** (vhost-user-gpu:3056): CRITICAL **: 17:52:52.115: vg_process_msg: assertion 'g->sock_fd == -1' failed

The guest serial output shows:

[    1.955522] [drm] pci: virtio-gpu-pci detected at 0000:00:01.0
[    1.957712] [drm] features: +virgl +edid -resource_blob -host_visible
[    1.957716] [drm] features: -context_init
[    1.963817] [drm] number of scanouts: 1
[    1.964926] [drm] number of cap sets: 2
[    2.006935] [drm] cap set 0: id 1, max-version 1, max-size 308
[    2.008039] [drm] cap set 1: id 2, max-version 2, max-size 1408
qemu: failed to read msg header: 0, 11
qemu: Unexpected end-of-file before all data were read

Closing the QEMU process leads to:

qemu: Failed to set msg fds.
qemu: vhost_get_config failed: 无效的参数
qemu: Failed to set msg fds.
qemu: vhost-user-gpu: set device config space failed
qemu: Failed to set msg fds.
qemu: Failed to set msg fds.
qemu: vhost VQ 0 ring restore failed: -22: 无效的参数 (22)
qemu: Failed to set msg fds.
qemu: vhost VQ 1 ring restore failed: -22: 无效的参数 (22)
qemu: Failed to set msg fds.
qemu: vhost_set_vring_call failed 22
qemu: Failed to set msg fds.
qemu: vhost_set_vring_call failed 22
set virtio-gpu status to 15 failed, old status: 15

"无效的参数" means "invalid parameters" in English.

Steps to reproduce

  1. start vhost-user-gpu first.
  2. start QEMU and notice the error message.

Additional information

I'm happy to provide a loongarch vhost-user-gpu patch, but I'm not sure how to resolve this problem. If further logs are needed, please let me know.

Thanks.