Skip to content

hw/nvme: create parameter to enable/disable cmic on subsystem

Alan Adamson qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1hw/nvme: create parameter to enable/disable cmic on subsystemhw/nvme/ctrl.c hw/nvme/nvme.h hw/nvme/subsys.c+6 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] hw/nvme: create parameter to enable/disable cmic on subsystem

While testing Linux atomic writes with qemu-nvme v10.0.0-rc1, Linux was incorrectly displaying atomic_write_max_bytes

# cat /sys/block/nvme0n1/queue/atomic_write_max_bytes
0
# nvme id-ctrl /dev/nvme0n1 | grep awupf
awupf     : 15
#
Since AWUPF was set to 15, it was expected atomic_write_max_bytes would
be set to 8192.

The commit cd59f50ab017 ("hw/nvme: always initialize a subsystem") introduced this behavior. The commit hardcodes the subsystem cmic bit to ON which caused the Linux NVMe driver to treat the namespace as multi-pathed which uncovered a bug with how Atomic Write Queue Limits were being inherited. This Linux issue is being addressed, but the question was asked of why the subsystem cmic bit was hardcoded to ON. Most NVMe devices today don't set cmic to ON. Shouldn't the setting of this bit be a settable parameter?

<subsystem>,cmic=BOOLEAN (default: off)

Example:

    -device nvme-subsys,id=subsys0,cmic=on \
    -device nvme,serial=deadbeef,id=nvme0,subsys=subsys0,atomic.dn=off,atomic.awun=31,atomic.awupf=15 \
    -drive id=ns1,file=/dev/nullb3,if=none \
    -device nvme-ns,drive=ns1,bus=nvme0,nsid=1,shared=false 

Alan Adamson (1):
hw/nvme: create parameter to enable/disable cmic on subsystem

 hw/nvme/ctrl.c   | 5 ++++-
 hw/nvme/nvme.h   | 1 +
 hw/nvme/subsys.c | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.5