]> git.baikalelectronics.ru Git - kernel.git/commit
um: read multiple msg from virtio slave request fd
authorBenjamin Beichler <benjamin.beichler@uni-rostock.de>
Tue, 7 Jun 2022 11:27:14 +0000 (11:27 +0000)
committerRichard Weinberger <richard@nod.at>
Mon, 19 Sep 2022 20:28:25 +0000 (22:28 +0200)
commit208560a542b03b759f8c7b98374d15c3fbf981b4
treee1075a36fcf3b9abd0d9a1ca1108ef357a48b1ee
parent05bef87d4e52d4941084179068f4fb24ca7c702c
um: read multiple msg from virtio slave request fd

If VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS is activated, the user mode
linux virtio irq handler only read one msg from the corresponding socket.
This creates issues, when the device emulation creates multiple call
requests (e.g. for multiple virtqueues), as the socket buffer tend to fill
up and the call requests are delayed.

This creates a deadlock situation, when the device simulation blocks,
because of sending a msg and the kernel side blocks because of
synchronously waiting for an acknowledge of kick request.

Actually inband notifications are meant to be used in combination with the
time travel protocol, but it is not required, therefore this corner case
needs to be handled.

Anyways, in general it seems to be more natural to consume always all
messages from a socket, instead of only a single one.

Fixes: 7820c2d8a588 ("um: virtio: Implement VHOST_USER_PROTOCOL_F_SLAVE_REQ")
Signed-off-by: Benjamin Beichler <benjamin.beichler@uni-rostock.de>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/virtio_uml.c