Skip to content

Commit bf82c2c

Browse files
jasowanggregkh
authored andcommitted
vhost: correctly check the iova range when waking virtqueue
[ Upstream commit 2d66f99 ] We don't wakeup the virtqueue if the first byte of pending iova range is the last byte of the range we just got updated. This will lead a virtqueue to wait for IOTLB updating forever. Fixing by correct the check and wake up the virtqueue in this case. Fixes: 6b1e6cc ("vhost: new device IOTLB API") Reported-by: Peter Xu <[email protected]> Signed-off-by: Jason Wang <[email protected]> Reviewed-by: Peter Xu <[email protected]> Tested-by: Peter Xu <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fe0d111 commit bf82c2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vhost/vhost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ static void vhost_iotlb_notify_vq(struct vhost_dev *d,
960960
list_for_each_entry_safe(node, n, &d->pending_list, node) {
961961
struct vhost_iotlb_msg *vq_msg = &node->msg.iotlb;
962962
if (msg->iova <= vq_msg->iova &&
963-
msg->iova + msg->size - 1 > vq_msg->iova &&
963+
msg->iova + msg->size - 1 >= vq_msg->iova &&
964964
vq_msg->type == VHOST_IOTLB_MISS) {
965965
vhost_poll_queue(&node->vq->poll);
966966
list_del(&node->node);

0 commit comments

Comments
 (0)