aboutsummaryrefslogtreecommitdiff
path: root/hw/nvme/nvme.h
diff options
context:
space:
mode:
authorKlaus Jensen <k.jensen@samsung.com>2023-07-19 20:21:58 +0200
committerKlaus Jensen <k.jensen@samsung.com>2023-08-07 12:27:24 +0200
commit6a33f2e920ec0b489a77200888e3692664077f2d (patch)
tree8ecefcbed8bf979452ca8011dd5d02cc98f324ae /hw/nvme/nvme.h
parentecb1b7b082d3b7dceff0e486a114502fc52c0fdf (diff)
downloadqemu-6a33f2e920ec0b489a77200888e3692664077f2d.zip
qemu-6a33f2e920ec0b489a77200888e3692664077f2d.tar.gz
qemu-6a33f2e920ec0b489a77200888e3692664077f2d.tar.bz2
hw/nvme: fix compliance issue wrt. iosqes/iocqes
As of prior to this patch, the controller checks the value of CC.IOCQES and CC.IOSQES prior to enabling the controller. As reported by Ben in GitLab issue #1691, this is not spec compliant. The controller should only check these values when queues are created. This patch moves these checks to nvme_create_cq(). We do not need to check it in nvme_create_sq() since that will error out if the completion queue is not already created. Also, since the controller exclusively supports SQEs of size 64 bytes and CQEs of size 16 bytes, hard code that. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1691 Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw/nvme/nvme.h')
-rw-r--r--hw/nvme/nvme.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h
index 209e8f5..5f2ae7b 100644
--- a/hw/nvme/nvme.h
+++ b/hw/nvme/nvme.h
@@ -30,6 +30,13 @@
#define NVME_FDP_MAX_EVENTS 63
#define NVME_FDP_MAXPIDS 128
+/*
+ * The controller only supports Submission and Completion Queue Entry Sizes of
+ * 64 and 16 bytes respectively.
+ */
+#define NVME_SQES 6
+#define NVME_CQES 4
+
QEMU_BUILD_BUG_ON(NVME_MAX_NAMESPACES > NVME_NSID_BROADCAST - 1);
typedef struct NvmeCtrl NvmeCtrl;
@@ -530,8 +537,6 @@ typedef struct NvmeCtrl {
uint32_t page_size;
uint16_t page_bits;
uint16_t max_prp_ents;
- uint16_t cqe_size;
- uint16_t sqe_size;
uint32_t max_q_ents;
uint8_t outstanding_aers;
uint32_t irq_status;