mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
vhost: correctly check the iova range when waking virtqueue
[ Upstream commit2d66f997f0
] 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:6b1e6cc785
("vhost: new device IOTLB API") Reported-by: Peter Xu <peterx@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Tested-by: Peter Xu <peterx@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fe0d111fea
commit
bf82c2cb14
1 changed files with 1 additions and 1 deletions
|
@ -960,7 +960,7 @@ static void vhost_iotlb_notify_vq(struct vhost_dev *d,
|
|||
list_for_each_entry_safe(node, n, &d->pending_list, node) {
|
||||
struct vhost_iotlb_msg *vq_msg = &node->msg.iotlb;
|
||||
if (msg->iova <= vq_msg->iova &&
|
||||
msg->iova + msg->size - 1 > vq_msg->iova &&
|
||||
msg->iova + msg->size - 1 >= vq_msg->iova &&
|
||||
vq_msg->type == VHOST_IOTLB_MISS) {
|
||||
vhost_poll_queue(&node->vq->poll);
|
||||
list_del(&node->node);
|
||||
|
|
Loading…
Reference in a new issue