aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2018-11-26 10:17:45 -0700
committerKevin Wolf <kwolf@redhat.com>2018-11-27 12:59:00 +0100
commit6da021815e752b3ca3a547eed53f3e92a8a35452 (patch)
treef9e45222736c566916af8dc65ab1a9cfa7798af3
parent330ca111ea0979d8c6fc9b3958f72d6dce164d5a (diff)
downloadqemu-6da021815e752b3ca3a547eed53f3e92a8a35452.zip
qemu-6da021815e752b3ca3a547eed53f3e92a8a35452.tar.gz
qemu-6da021815e752b3ca3a547eed53f3e92a8a35452.tar.bz2
nvme: Fix spurious interrupts
The code had asserted an interrupt every time it was requested to check for new completion queue entries.This can result in spurious interrupts seen by the guest OS. Fix this by asserting an interrupt only if there are un-acknowledged completion queue entries available. Reported-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Keith Busch <keith.busch@intel.com> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--hw/block/nvme.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 9fbe567..7c8c63e 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -272,7 +272,9 @@ static void nvme_post_cqes(void *opaque)
sizeof(req->cqe));
QTAILQ_INSERT_TAIL(&sq->req_list, req, entry);
}
- nvme_irq_assert(n, cq);
+ if (cq->tail != cq->head) {
+ nvme_irq_assert(n, cq);
+ }
}
static void nvme_enqueue_req_completion(NvmeCQueue *cq, NvmeRequest *req)