qemu-e2k/hw/nvme
Dmitry Tikhov d7fe639cab hw/nvme: add new command abort case
NVMe command set specification for end-to-end data protection formatted
namespace states:

    o If the Reference Tag Check bit of the PRCHK field is set to ‘1’ and
      the namespace is formatted for Type 3 protection, then the
      controller:
          ▪ should not compare the protection Information Reference Tag
            field to the computed reference tag; and
          ▪ may ignore the ILBRT and EILBRT fields. If a command is
            aborted as a result of the Reference Tag Check bit of the
            PRCHK field being set to ‘1’, then that command should be
            aborted with a status code of Invalid Protection Information,
            but may be aborted with a status code of Invalid Field in
            Command.

Currently qemu compares reftag in the nvme_dif_prchk function whenever
Reference Tag Check bit is set in the command. For type 3 namespaces
however, caller of nvme_dif_prchk - nvme_dif_check does not increment
reftag for each subsequent logical block. That way commands incorporating
more than one logical block for type 3 formatted namespaces with reftag
check bit set, always fail with End-to-end Reference Tag Check Error.
Comply with spec by handling case of set Reference Tag Check
bit in the type 3 formatted namespace.

Fixes: 146f720c55 ("hw/block/nvme: end-to-end data protection")
Signed-off-by: Dmitry Tikhov <d.tihov@yadro.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
2022-06-03 21:48:24 +02:00
..
Kconfig
ctrl.c hw/nvme: bump firmware revision 2022-06-03 21:48:24 +02:00
dif.c hw/nvme: add new command abort case 2022-06-03 21:48:24 +02:00
dif.h hw/nvme: 64-bit pi support 2022-03-03 09:30:21 +01:00
meson.build
ns.c hw/nvme: do not auto-generate uuid 2022-06-03 21:48:24 +02:00
nvme.h hw/nvme: enforce common serial per subsystem 2022-06-03 21:48:24 +02:00
subsys.c hw/nvme: enforce common serial per subsystem 2022-06-03 21:48:24 +02:00
trace-events hw/nvme: 64-bit pi support 2022-03-03 09:30:21 +01:00
trace.h