aboutsummaryrefslogtreecommitdiff
path: root/hw/nvme
diff options
context:
space:
mode:
authorAnkit Kumar <ankit.kumar@samsung.com>2023-08-08 02:57:43 +0530
committerKlaus Jensen <k.jensen@samsung.com>2023-08-08 08:09:38 +0200
commitdbdb13f931d7cf2d3c3ca662e751bb1551e9eab6 (patch)
tree44debf034329f7228ea24ca61cf19b0c4af1fe3c /hw/nvme
parent0450cf08976f9036feaded438031b4cba94f6452 (diff)
downloadqemu-dbdb13f931d7cf2d3c3ca662e751bb1551e9eab6.zip
qemu-dbdb13f931d7cf2d3c3ca662e751bb1551e9eab6.tar.gz
qemu-dbdb13f931d7cf2d3c3ca662e751bb1551e9eab6.tar.bz2
hw/nvme: fix CRC64 for guard tag
The nvme CRC64 generator expects the caller to pass inverted seed value. Pass inverted crc value for metadata buffer. Cc: qemu-stable@nongnu.org Fixes: 44219b6029fc ("hw/nvme: 64-bit pi support") Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw/nvme')
-rw-r--r--hw/nvme/dif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/nvme/dif.c b/hw/nvme/dif.c
index 63c44c8..01b19c3 100644
--- a/hw/nvme/dif.c
+++ b/hw/nvme/dif.c
@@ -115,7 +115,7 @@ static void nvme_dif_pract_generate_dif_crc64(NvmeNamespace *ns, uint8_t *buf,
uint64_t crc = crc64_nvme(~0ULL, buf, ns->lbasz);
if (pil) {
- crc = crc64_nvme(crc, mbuf, pil);
+ crc = crc64_nvme(~crc, mbuf, pil);
}
dif->g64.guard = cpu_to_be64(crc);
@@ -246,7 +246,7 @@ static uint16_t nvme_dif_prchk_crc64(NvmeNamespace *ns, NvmeDifTuple *dif,
uint64_t crc = crc64_nvme(~0ULL, buf, ns->lbasz);
if (pil) {
- crc = crc64_nvme(crc, mbuf, pil);
+ crc = crc64_nvme(~crc, mbuf, pil);
}
trace_pci_nvme_dif_prchk_guard_crc64(be64_to_cpu(dif->g64.guard), crc);