[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces
From: |
Klaus Jensen |
Subject: |
[PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces |
Date: |
Fri, 3 Jun 2022 21:53:46 +0200 |
From: Dmitry Tikhov <d.tihov@yadro.com>
Current implementation have problem in the read part of copy command.
Because there is no metadata mangling before nvme_dif_check invocation,
reftag error could be thrown for blocks of namespace that have not been
previously written to.
Signed-off-by: Dmitry Tikhov <d.tihov@yadro.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ctrl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 74540a03d518..08574c4dcbc8 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -2787,6 +2787,10 @@ static void nvme_copy_in_completed_cb(void *opaque, int
ret)
size_t mlen = nvme_m2b(ns, nlb);
uint8_t *mbounce = iocb->bounce + nvme_l2b(ns, nlb);
+ status = nvme_dif_mangle_mdata(ns, mbounce, mlen, slba);
+ if (status) {
+ goto invalid;
+ }
status = nvme_dif_check(ns, iocb->bounce, len, mbounce, mlen, prinfor,
slba, apptag, appmask, &reftag);
if (status) {
--
2.36.1
- [PULL 00/11] hw/nvme updates, Klaus Jensen, 2022/06/03
- [PULL 01/11] hw/nvme: fix narrowing conversion, Klaus Jensen, 2022/06/03
- [PULL 02/11] hw/nvme: add missing return statement, Klaus Jensen, 2022/06/03
- [PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces,
Klaus Jensen <=
- [PULL 04/11] hw/nvme: fix smart aen, Klaus Jensen, 2022/06/03
- [PULL 05/11] hw/nvme: enforce common serial per subsystem, Klaus Jensen, 2022/06/03
- [PULL 06/11] hw/nvme: do not auto-generate eui64, Klaus Jensen, 2022/06/03
- [PULL 07/11] hw/nvme: do not auto-generate uuid, Klaus Jensen, 2022/06/03
- [PULL 08/11] hw/nvme: do not report null uuid, Klaus Jensen, 2022/06/03
- [PULL 09/11] hw/nvme: bump firmware revision, Klaus Jensen, 2022/06/03
- [PULL 10/11] hw/nvme: deprecate the use-intel-id compatibility parameter, Klaus Jensen, 2022/06/03
- [PULL 11/11] hw/nvme: add new command abort case, Klaus Jensen, 2022/06/03
- Re: [PULL 00/11] hw/nvme updates, Richard Henderson, 2022/06/03