aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Tuffli <chuck@FreeBSD.org>2022-01-30 07:11:14 +0000
committerChuck Tuffli <chuck@FreeBSD.org>2022-02-22 03:28:39 +0000
commiteae02d959363fc575b1727ed23e6f1542802d551 (patch)
treeb60cb798f177c548a3c729eddb3e4a0c5d78ca6b
parentd9685b5787b310d2244274afa3d044831edcc6f8 (diff)
downloadsrc-eae02d959363.tar.gz
src-eae02d959363.zip
bhyve nvme: Fix Identify Namespace, NSID=ffffffff
If the NVMe Controller doesn't support Namespace Management, it should return "Invalid Namespace or Format" when the Host request Identify Namespace with the global NSID value. Fixes UNH IOL 16.0 Test 9.1, Case 6 (cherry picked from commit ac678b4aaf1e852aa033906eabee7322d985c810)
-rw-r--r--usr.sbin/bhyve/pci_nvme.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c
index ba05871f21a1..291d6676f7ce 100644
--- a/usr.sbin/bhyve/pci_nvme.c
+++ b/usr.sbin/bhyve/pci_nvme.c
@@ -1482,6 +1482,12 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nvme_command* command,
switch (command->cdw10 & 0xFF) {
case 0x00: /* return Identify Namespace data structure */
+ /* Global NS only valid with NS Management */
+ if (command->nsid == NVME_GLOBAL_NAMESPACE_TAG) {
+ pci_nvme_status_genc(&status,
+ NVME_SC_INVALID_NAMESPACE_OR_FORMAT);
+ break;
+ }
nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1,
command->prp2, (uint8_t *)&sc->nsdata, sizeof(sc->nsdata),
NVME_COPY_TO_PRP);