hw/nvme: fix compliance issue wrt. iosqes/iocqes
commit6a33f2e920ec0b489a77200888e3692664077f2d
authorKlaus Jensen <k.jensen@samsung.com>
Wed, 19 Jul 2023 18:21:58 +0000 (19 20:21 +0200)
committerKlaus Jensen <k.jensen@samsung.com>
Mon, 7 Aug 2023 10:27:24 +0000 (7 12:27 +0200)
tree8ecefcbed8bf979452ca8011dd5d02cc98f324ae
parentecb1b7b082d3b7dceff0e486a114502fc52c0fdf
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>
hw/nvme/ctrl.c
hw/nvme/nvme.h
hw/nvme/trace-events