aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Birkelund Jensen <klaus@birkelund.eu>2019-05-18 09:39:05 +0200
committerKevin Wolf <kwolf@redhat.com>2019-05-20 17:08:56 +0200
commit25349e8250e67e7d126fbf0ad213811b62e7e529 (patch)
treee7844104ca4ae4bdda4a717dab3008a94baa2c6f
parent832d78caa51e7ac3c17a37f2c0ed9d904e423a32 (diff)
downloadqemu-25349e8250e67e7d126fbf0ad213811b62e7e529.zip
qemu-25349e8250e67e7d126fbf0ad213811b62e7e529.tar.gz
qemu-25349e8250e67e7d126fbf0ad213811b62e7e529.tar.bz2
nvme: fix copy direction in DMA reads going to CMB
`nvme_dma_read_prp` erronously used `qemu_iovec_*to*_buf` instead of `qemu_iovec_*from*_buf` when the request involved the controller memory buffer. Signed-off-by: Klaus Birkelund Jensen <klaus.jensen@cnexlabs.com> Reviewed-by: Kenneth Heitke <kenneth.heitke@intel.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--hw/block/nvme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 7caf925..63a5b58 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -238,7 +238,7 @@ static uint16_t nvme_dma_read_prp(NvmeCtrl *n, uint8_t *ptr, uint32_t len,
}
qemu_sglist_destroy(&qsg);
} else {
- if (unlikely(qemu_iovec_to_buf(&iov, 0, ptr, len) != len)) {
+ if (unlikely(qemu_iovec_from_buf(&iov, 0, ptr, len) != len)) {
trace_nvme_err_invalid_dma();
status = NVME_INVALID_FIELD | NVME_DNR;
}