Message ID | 20180910145616.8598-2-famz@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | virtio-scsi: Fix QEMU hang with vIOMMU and ATS | expand |
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index d4e4d98b59..7a05c9e52c 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -358,6 +358,10 @@ int virtio_queue_ready(VirtQueue *vq) * Called within rcu_read_lock(). */ static int virtio_queue_empty_rcu(VirtQueue *vq) { + if (unlikely(vq->vdev->broken)) { + return 1; + } + if (unlikely(!vq->vring.avail)) { return 1; } @@ -373,6 +377,10 @@ int virtio_queue_empty(VirtQueue *vq) { bool empty; + if (unlikely(vq->vdev->broken)) { + return 1; + } + if (unlikely(!vq->vring.avail)) { return 1; }