mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
emulated nvme updates and fixes
* fixes for Coverity CID 1450756, 1450757 and 1450758 (me) * fix for a bug in zone management receive (me) * metadata and end-to-end data protection support (me & Gollu Appalanaidu) * verify support (Gollu Appalanaidu) * multiple lba formats and format nvm support (Minwoo Im) and a couple of misc refactorings from me. v2: - remove an unintended submodule update. Argh. -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmBTP0wACgkQTeGvMW1P DelZvAf+Ijw77YLz2t0P97CiwoOAG4FADwo61WQJo2AHyS3JMYPVdgNUXF7UGt/S cNhU1JjdEylgZPKi5t9o/qgy7+vtSL0KKqoXIS0z9ZWZkdFsgObNetGULhaqXgaX 4KcAt7PyJS/33uFqYGSVZxJTO4GtCy34hGw6XrVs388tQD1S+eI+oS5EYBN57rl9 MrV5Z72iMCBx8Y074u81SD/u7n34b5WWbUOJADVI1rAKhilDhnkAhBQ/gK/UBodB trUUQY/KU+eCnXEqfBeMD6fL75UOAFOjnm7Kfk/Q/g3di3H2fu0RGLrJuSS1dG0n zmwgE7pQ1jT1UcB3QwAJLR3tGtd6sA== =HwqP -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/nvme/tags/nvme-next-pull-request' into staging emulated nvme updates and fixes * fixes for Coverity CID 1450756, 1450757 and 1450758 (me) * fix for a bug in zone management receive (me) * metadata and end-to-end data protection support (me & Gollu Appalanaidu) * verify support (Gollu Appalanaidu) * multiple lba formats and format nvm support (Minwoo Im) and a couple of misc refactorings from me. v2: - remove an unintended submodule update. Argh. # gpg: Signature made Thu 18 Mar 2021 11:53:48 GMT # gpg: using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9 # gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown] # gpg: aka "Klaus Jensen <k.jensen@samsung.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468 4272 63D5 6FC5 E55D A838 # Subkey fingerprint: 5228 33AA 75E2 DCE6 A247 66C0 4DE1 AF31 6D4F 0DE9 * remotes/nvme/tags/nvme-next-pull-request: hw/block/nvme: add support for the format nvm command hw/block/nvme: pull lba format initialization hw/block/nvme: prefer runtime helpers instead of device parameters hw/block/nvme: support multiple lba formats hw/block/nvme: add non-mdts command size limit for verify hw/block/nvme: add verify command hw/block/nvme: end-to-end data protection hw/block/nvme: add metadata support hw/block/nvme: fix zone management receive reporting too many zones hw/block/nvme: assert namespaces array indices hw/block/nvme: fix potential overflow Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
8a40754bca
11 changed files with 1939 additions and 159 deletions
|
@ -580,6 +580,7 @@ enum NvmeIoCommands {
|
|||
NVME_CMD_COMPARE = 0x05,
|
||||
NVME_CMD_WRITE_ZEROES = 0x08,
|
||||
NVME_CMD_DSM = 0x09,
|
||||
NVME_CMD_VERIFY = 0x0c,
|
||||
NVME_CMD_COPY = 0x19,
|
||||
NVME_CMD_ZONE_MGMT_SEND = 0x79,
|
||||
NVME_CMD_ZONE_MGMT_RECV = 0x7a,
|
||||
|
@ -696,12 +697,17 @@ enum {
|
|||
NVME_RW_DSM_LATENCY_LOW = 3 << 4,
|
||||
NVME_RW_DSM_SEQ_REQ = 1 << 6,
|
||||
NVME_RW_DSM_COMPRESSED = 1 << 7,
|
||||
NVME_RW_PIREMAP = 1 << 9,
|
||||
NVME_RW_PRINFO_PRACT = 1 << 13,
|
||||
NVME_RW_PRINFO_PRCHK_GUARD = 1 << 12,
|
||||
NVME_RW_PRINFO_PRCHK_APP = 1 << 11,
|
||||
NVME_RW_PRINFO_PRCHK_REF = 1 << 10,
|
||||
NVME_RW_PRINFO_PRCHK_MASK = 7 << 10,
|
||||
|
||||
};
|
||||
|
||||
#define NVME_RW_PRINFO(control) ((control >> 10) & 0xf)
|
||||
|
||||
typedef struct QEMU_PACKED NvmeDsmCmd {
|
||||
uint8_t opcode;
|
||||
uint8_t flags;
|
||||
|
@ -822,6 +828,7 @@ enum NvmeStatusCodes {
|
|||
NVME_CAP_EXCEEDED = 0x0081,
|
||||
NVME_NS_NOT_READY = 0x0082,
|
||||
NVME_NS_RESV_CONFLICT = 0x0083,
|
||||
NVME_FORMAT_IN_PROGRESS = 0x0084,
|
||||
NVME_INVALID_CQID = 0x0100,
|
||||
NVME_INVALID_QID = 0x0101,
|
||||
NVME_MAX_QSIZE_EXCEEDED = 0x0102,
|
||||
|
@ -1079,6 +1086,7 @@ enum NvmeIdCtrlOncs {
|
|||
NVME_ONCS_FEATURES = 1 << 4,
|
||||
NVME_ONCS_RESRVATIONS = 1 << 5,
|
||||
NVME_ONCS_TIMESTAMP = 1 << 6,
|
||||
NVME_ONCS_VERIFY = 1 << 7,
|
||||
NVME_ONCS_COPY = 1 << 8,
|
||||
};
|
||||
|
||||
|
@ -1324,14 +1332,22 @@ typedef struct QEMU_PACKED NvmeIdNsZoned {
|
|||
#define NVME_ID_NS_DPC_TYPE_MASK 0x7
|
||||
|
||||
enum NvmeIdNsDps {
|
||||
DPS_TYPE_NONE = 0,
|
||||
DPS_TYPE_1 = 1,
|
||||
DPS_TYPE_2 = 2,
|
||||
DPS_TYPE_3 = 3,
|
||||
DPS_TYPE_MASK = 0x7,
|
||||
DPS_FIRST_EIGHT = 8,
|
||||
NVME_ID_NS_DPS_TYPE_NONE = 0,
|
||||
NVME_ID_NS_DPS_TYPE_1 = 1,
|
||||
NVME_ID_NS_DPS_TYPE_2 = 2,
|
||||
NVME_ID_NS_DPS_TYPE_3 = 3,
|
||||
NVME_ID_NS_DPS_TYPE_MASK = 0x7,
|
||||
NVME_ID_NS_DPS_FIRST_EIGHT = 8,
|
||||
};
|
||||
|
||||
#define NVME_ID_NS_DPS_TYPE(dps) (dps & NVME_ID_NS_DPS_TYPE_MASK)
|
||||
|
||||
typedef struct NvmeDifTuple {
|
||||
uint16_t guard;
|
||||
uint16_t apptag;
|
||||
uint32_t reftag;
|
||||
} NvmeDifTuple;
|
||||
|
||||
enum NvmeZoneAttr {
|
||||
NVME_ZA_FINISHED_BY_CTLR = 1 << 0,
|
||||
NVME_ZA_FINISH_RECOMMENDED = 1 << 1,
|
||||
|
@ -1428,5 +1444,6 @@ static inline void _nvme_check_size(void)
|
|||
QEMU_BUILD_BUG_ON(sizeof(NvmeSglDescriptor) != 16);
|
||||
QEMU_BUILD_BUG_ON(sizeof(NvmeIdNsDescr) != 4);
|
||||
QEMU_BUILD_BUG_ON(sizeof(NvmeZoneDescr) != 64);
|
||||
QEMU_BUILD_BUG_ON(sizeof(NvmeDifTuple) != 8);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue