@@ -8876,7 +8876,10 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev)
id->psd[0].enlat = cpu_to_le32(0x10);
id->psd[0].exlat = cpu_to_le32(0x4);
- id->cmic |= NVME_CMIC_MULTI_CTRL;
+ if (n->subsys->params.cmic) {
+ id->cmic |= NVME_CMIC_MULTI_CTRL;
+ }
+
ctratt |= NVME_CTRATT_ENDGRPS;
id->endgidmax = cpu_to_le16(0x1);
@@ -116,6 +116,7 @@ typedef struct NvmeSubsystem {
uint16_t nruh;
uint32_t nrg;
} fdp;
+ bool cmic;
} params;
} NvmeSubsystem;
@@ -223,6 +223,7 @@ static const Property nvme_subsystem_props[] = {
NVME_DEFAULT_RU_SIZE),
DEFINE_PROP_UINT32("fdp.nrg", NvmeSubsystem, params.fdp.nrg, 1),
DEFINE_PROP_UINT16("fdp.nruh", NvmeSubsystem, params.fdp.nruh, 0),
+ DEFINE_PROP_BOOL("cmic", NvmeSubsystem, params.cmic, false),
};
static void nvme_subsys_class_init(ObjectClass *oc, void *data)
Allow the value of CMIC to to be set via a new subsystem specific parameter. This removes the requirement that all subsystems must have the CMIC bit enabled. New NVMe Subsystem QEMU Parameter (See NVMe Specification for details): <subsystem>,cmic=BOOLEAN (default: off) Signed-off-by: Alan Adamson <alan.adamson@oracle.com> --- hw/nvme/ctrl.c | 5 ++++- hw/nvme/nvme.h | 1 + hw/nvme/subsys.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)