summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorKlaus Jensen2020-09-30 01:19:07 +0200
committerKlaus Jensen2020-10-27 11:29:25 +0100
commit1b48e4611a7a3ee3065d3bb8428f5f6acb5232fe (patch)
tree5ec1a14c661eb2103adf6bdcfac19246eaf17836 /include/block
parenthw/block/nvme: support for admin-only command set (diff)
downloadqemu-1b48e4611a7a3ee3065d3bb8428f5f6acb5232fe.tar.gz
qemu-1b48e4611a7a3ee3065d3bb8428f5f6acb5232fe.tar.xz
qemu-1b48e4611a7a3ee3065d3bb8428f5f6acb5232fe.zip
hw/block/nvme: reject io commands if only admin command set selected
If the host sets CC.CSS to 111b, all commands submitted to I/O queues should be completed with status Invalid Command Opcode. Note that this is technically a v1.4 feature, but it does not hurt to implement before we finally bump the reported version implemented. Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/nvme.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/block/nvme.h b/include/block/nvme.h
index 521533fd2a..6de2d5aa75 100644
--- a/include/block/nvme.h
+++ b/include/block/nvme.h
@@ -115,6 +115,11 @@ enum NvmeCcMask {
#define NVME_CC_IOSQES(cc) ((cc >> CC_IOSQES_SHIFT) & CC_IOSQES_MASK)
#define NVME_CC_IOCQES(cc) ((cc >> CC_IOCQES_SHIFT) & CC_IOCQES_MASK)
+enum NvmeCcCss {
+ NVME_CC_CSS_NVM = 0x0,
+ NVME_CC_CSS_ADMIN_ONLY = 0x7,
+};
+
enum NvmeCstsShift {
CSTS_RDY_SHIFT = 0,
CSTS_CFS_SHIFT = 1,