projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0450cf0
)
hw/nvme: fix CRC64 for guard tag
author
Ankit Kumar
<ankit.kumar@samsung.com>
Mon, 7 Aug 2023 21:27:43 +0000
(
02:57
+0530)
committer
Klaus Jensen
<k.jensen@samsung.com>
Tue, 8 Aug 2023 06:09:38 +0000
(08:09 +0200)
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>
hw/nvme/dif.c
patch
|
blob
|
history
diff --git
a/hw/nvme/dif.c
b/hw/nvme/dif.c
index 63c44c86ab554082a4c4e139d7a780a3d9f210a5..01b19c33734e2ccea25300b227078b82c94fde9e 100644
(file)
--- 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);