qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] nvme: fix copy direction in DMA reads going to


From: Heitke, Kenneth
Subject: Re: [Qemu-block] [PATCH] nvme: fix copy direction in DMA reads going to CMB
Date: Sat, 18 May 2019 11:56:39 -0600
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1



On 5/18/2019 1:39 AM, Klaus Birkelund Jensen wrote:
`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 <address@hidden>
---
  hw/block/nvme.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 7caf92532a09..63a5b58849fb 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;
          }


Reviewed-by: Kenneth Heitke <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]