Skip to contentSkip to conversation

Fixed NVM Express device versioning.

PATCH New Stephen Bates 2 participants 2 messages Feb 4, 2015 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixed NVM Express device versioning.

The NVMe specification indicates how the minor and major version numbers should be represented in the version field of the NVMe controller registers. We correct the code to align with the specification.

If CMB is requested we advertise as a 1.2 drive, if not we advertise 1.1.

Signed-off-by Stephen Bates <stephen.bates at pmcs.com>

---
hw/block/nvme.c | 8 +++++++-

1 file changed, 7 insertions(+), 1 deletion(-)
hw/block/nvme.c +3 -0
index 4e81fb1..2e4ac19 100644
@@ -68,6 +68,9 @@
  * and fail to load if there is a conflict or a configuration the emulated
  * device is unable to handle.
  *
+ * Note that when a CMB is requested the NVMe version is set to 1.2,
+ * for all other cases it is set to 1.1.
+ *
  */
 

/**
@@ -1959,7 +1962,10 @@ static void nvme_init_ctrl(NvmeCtrl *n)

     NVME_CAP_SET_MPSMIN(n->bar.cap, n->mpsmin);
     NVME_CAP_SET_MPSMAX(n->bar.cap, n->mpsmax);

- n->bar.vs = 0x00010001;
+ if (n->cmb)
+ n->bar.vs = 0x00010200;
+ else

+        n->bar.vs = 0x00010100;
     n->bar.intmc = n->bar.intms = 0;
     n->temperature = NVME_TEMPERATURE;
}

--
1.7.10.4

Cheers

Stephen

Applied
#1 lore raw

PATCH 1/1 Fixed NVM Express device versioning.

Quoted 9 lines · Stephen Bates

The NVMe specification indicates how the minor and major version numbers should be represented in the version field of the NVMe controller registers. We correct the code to align with the specification.

If CMB is requested we advertise as a 1.2 drive, if not we advertise 1.1.

Signed-off-by Stephen Bates <stephen.bates at pmcs.com>

Applied, thanks!