On Mon, Mar 2, 2026 at 4:51 PM Michael S. Tsirkin <[email protected]> wrote: > > vhost_get_avail_idx is supposed to report whether it has updated > vq->avail_idx. Instead, it returns whether all entries have been > consumed, which is usually the same. But not always - in > drivers/vhost/net.c and when mergeable buffers have been enabled, the > driver checks whether the combined entries are big enough to store an > incoming packet. If not, the driver re-enables notifications with > available entries still in the ring. The incorrect return value from > vhost_get_avail_idx propagates through vhost_enable_notify and causes > the host to livelock if the guest is not making progress, as vhost will > immediately disable notifications and retry using the available entries. > > The obvious fix is to make vhost_get_avail_idx do what the comment > says it does and report whether new entries have been added. > > Reported-by: ShuangYu <[email protected]> > Fixes: d3bb267bbdcb ("vhost: cache avail index in vhost_enable_notify()") > Cc: Stefano Garzarella <[email protected]> > Cc: Stefan Hajnoczi <[email protected]> > Signed-off-by: Michael S. Tsirkin <[email protected]> > --- >
Acked-by: Jason Wang <[email protected]> Thanks

