Hi Alex On Mon, Oct 23, 2023 at 8:34 PM Alex Bennée <alex.ben...@linaro.org> wrote: > > > Hi, > > I'm trying to get the contrib/vhost-user-input working but it exits > during the boot up sequence: > > ➜ gdb --args ./vhost-user-input -p /dev/input/event22 -s /tmp/mouse.sock > GNU gdb (GDB) 15.0.50.20231012-git > <snip> > Reading symbols from ./vhost-user-input... > (gdb) b map_ring > Breakpoint 1 at 0x7634c: file > ../../subprojects/libvhost-user/libvhost-user.c, line 618. > (gdb) r > Starting program: > /home/alex/lsrc/qemu.git/builds/arm.debug/contrib/vhost-user-input/vhost-user-input > -p /dev/input/event22 -s /tmp/mouse.sock > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > [New Thread 0x7ffff7afb6c0 (LWP 3807698)] > ================ Vhost user message ================ > Request: VHOST_USER_GET_FEATURES (1) > Flags: 0x1 > Size: 0 > Sending back to guest u64: 0x0000000175000000 > ================ Vhost user message ================ > Request: VHOST_USER_GET_PROTOCOL_FEATURES (15) > Flags: 0x1 > Size: 0 > ================ Vhost user message ================ > Request: VHOST_USER_SET_PROTOCOL_FEATURES (16) > Flags: 0x1 > Size: 8 > u64: 0x0000000000008e2b > ================ Vhost user message ================ > Request: VHOST_USER_GET_QUEUE_NUM (17) > Flags: 0x1 > Size: 0 > ================ Vhost user message ================ > Request: VHOST_USER_GET_MAX_MEM_SLOTS (36) > Flags: 0x1 > Size: 0 > u64: 0x0000000000000020 > ================ Vhost user message ================ > Request: VHOST_USER_SET_BACKEND_REQ_FD (21) > Flags: 0x9 > Size: 0 > Fds: 6 > Got backend_fd: 6 > ================ Vhost user message ================ > Request: VHOST_USER_SET_OWNER (3) > Flags: 0x1 > Size: 0 > ================ Vhost user message ================ > Request: VHOST_USER_GET_FEATURES (1) > Flags: 0x1 > Size: 0 > Sending back to guest u64: 0x0000000175000000 > ================ Vhost user message ================ > Request: VHOST_USER_SET_VRING_CALL (13) > Flags: 0x1 > Size: 8 > Fds: 7 > u64: 0x0000000000000000 > Got call_fd: 7 for vq: 0 > ================ Vhost user message ================ > Request: VHOST_USER_SET_VRING_ERR (14) > Flags: 0x1 > Size: 8 > Fds: 8 > u64: 0x0000000000000000 > ================ Vhost user message ================ > Request: VHOST_USER_SET_VRING_CALL (13) > Flags: 0x1 > Size: 8 > Fds: 9 > u64: 0x0000000000000001 > Got call_fd: 9 for vq: 1 > ================ Vhost user message ================ > Request: VHOST_USER_SET_VRING_ERR (14) > Flags: 0x1 > Size: 8 > Fds: 10 > u64: 0x0000000000000001 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_GET_CONFIG (24) > Flags: 0x1 > Size: 148 > ================ Vhost user message ================ > Request: VHOST_USER_SET_FEATURES (2) > Flags: 0x1 > Size: 8 > u64: 0x0000000170000000 > ================ Vhost user message ================ > Request: VHOST_USER_SET_VRING_NUM (8) > Flags: 0x1 > Size: 8 > State.index: 0 > State.num: 64 > ================ Vhost user message ================ > Request: VHOST_USER_SET_VRING_BASE (10) > Flags: 0x1 > Size: 8 > State.index: 0 > State.num: 0 > ================ Vhost user message ================ > Request: VHOST_USER_SET_VRING_ADDR (9) > Flags: 0x1 > Size: 40 > vhost_vring_addr: > index: 0 > flags: 0 > desc_user_addr: 0x00007f283491a000 > used_user_addr: 0x00007f283491a4c0 > avail_user_addr: 0x00007f283491a400 > log_guest_addr: 0x0000000100b1a4c0 > > Thread 1 "vhost-user-inpu" hit Breakpoint 1, map_ring (dev=0x7fffffffdd60, > vq=0x555555609ea0) at ../../subprojects/libvhost-user/libvhost-user.c:618 > warning: Source file is more recent than executable. > 618 vq->vring.desc = qva_to_va(dev, vq->vra.desc_user_addr); > (gdb) s > qva_to_va (dev=0x7fffffffdd60, qemu_addr=139810657378304) at > ../../subprojects/libvhost-user/libvhost-user.c:231 > 231 for (i = 0; i < dev->nregions; i++) { > (gdb) p dev->nregions > $1 = 0 > (gdb) n > 240 return NULL; > (gdb) > 241 } > (gdb) c > Continuing. > Setting virtq addresses: > vring_desc at (nil) > vring_used at (nil) > vring_avail at (nil) > > ** (vhost-user-input:3807669): CRITICAL **: 17:16:14.554: Invalid > vring_addr message > > [Thread 0x7ffff7afb6c0 (LWP 3807698) exited] > [Inferior 1 (process 3807669) exited with code 01] > (gdb) q > > Which looks like libvhost-user is expecting > VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS to be negotiated and the > resulting VHOST_USER_ADD_MEM_REG to be sent. How is this meant to work > if the protocol feature isn't negotiated?
How did you start QEMU ? Did you forget to use shared memory ? We should probably add some error at QEMU level when vhost-user devices are used without shared memory!