git: 62d47feceba8 - main - bhyve nvme: Fix Namespace Specific Set Features
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 29 Jan 2022 23:15:38 UTC
The branch main has been updated by chuck:
URL: https://cgit.FreeBSD.org/src/commit/?id=62d47feceba8d457f5a28691cfbed5b90ede30b6
commit 62d47feceba8d457f5a28691cfbed5b90ede30b6
Author: Chuck Tuffli <chuck@FreeBSD.org>
AuthorDate: 2022-01-30 07:06:23 +0000
Commit: Chuck Tuffli <chuck@FreeBSD.org>
CommitDate: 2022-01-30 07:06:23 +0000
bhyve nvme: Fix Namespace Specific Set Features
Return an error if the feature specified in Set Features is Namespace
specific but the Namespace ID uses the Global Namespace tag.
Fixes UNH Test 1.2.7
Reviewed by: imp, allanjude
Tested by: jason@tubnor.net
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33566
---
usr.sbin/bhyve/pci_nvme.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c
index 09425b1cace3..e5def8ef8165 100644
--- a/usr.sbin/bhyve/pci_nvme.c
+++ b/usr.sbin/bhyve/pci_nvme.c
@@ -1660,6 +1660,11 @@ nvme_opc_set_features(struct pci_nvme_softc *sc, struct nvme_command *command,
}
feat = &sc->feat[fid];
+ if (feat->namespace_specific && (nsid == NVME_GLOBAL_NAMESPACE_TAG)) {
+ pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD);
+ return (1);
+ }
+
if (!feat->namespace_specific &&
!((nsid == 0) || (nsid == NVME_GLOBAL_NAMESPACE_TAG))) {
pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC,