From nobody Sat Jan 29 23:15:46 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 892D3197B323; Sat, 29 Jan 2022 23:15:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JmVYb2SQxz3sTy; Sat, 29 Jan 2022 23:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643498147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yLgHin+MCXIfRxfv4+IFUePj+tu2tiPULqdnocBryMo=; b=DaQEejZcIKZKjU8m4TKZfXklJf5wtdLEyz5KAZvrY/YzytEimC3IUS24PrE7IgeApxQJZT ldY+Bd0KtA8cHyrDIqC6OE9lAgV/Nf2gw1VqtCUtKbEKg9DaBPxNnZnq9xRM6ExBNF+WOx MPCUg83FUHa3efHTR5hmxAd98sup5z75mbayoqcTCsWdLKLF5XymyIqXdQJ0tN3tRVvsFM EAgUqWZEYhcMvXrSYggbMHs8febGtNs2Yj8OU1MOgZjFo/JMhScr5m4TpeLa8+Jy34kjoj DQbtRsFrqKlabMnT4aSvoET4ABvsSF+1VDKf+EHxwwWnfhW9BzNAY7RjdAocbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E37A1E164; Sat, 29 Jan 2022 23:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20TNFku7008335; Sat, 29 Jan 2022 23:15:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20TNFkmX008334; Sat, 29 Jan 2022 23:15:46 GMT (envelope-from git) Date: Sat, 29 Jan 2022 23:15:46 GMT Message-Id: <202201292315.20TNFkmX008334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chuck Tuffli Subject: git: 073f2076fea4 - main - bhyve nvme: Add Select support to Get Features List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: chuck X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 073f2076fea4748b457b15dbd1d6e11b802b76f3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643498147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yLgHin+MCXIfRxfv4+IFUePj+tu2tiPULqdnocBryMo=; b=qNlc8Gu22mA3J2elWMb4EbHJGiXy1E/d0ngL6tVMLwOCTVfF0GCvMS5of/COG2GFK4c6tA 4ygNYg/ETuOHv1/szwiUMcqai4fmJlyx18ZeWT2p+/O67EFHwgrt4S6gAZBCArs4S8bCEi H87SAoFnRyfSg/bwCyPK+cvJgkYidFqJScDdKHmVKzlGEOtn69gBWvkP+KhalGty+4ix7r pP05ona1t6Z1CSTz8Yal04q+gvJXfvRgNulJbYoFm2amS5ITb05f8z9gDjwfyp7DmzTDrF A76byLvMcNiRe16PAyFeuW95OPo877X8CfDEwWAwHy7dPFtv81hwRGhevckuFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643498147; a=rsa-sha256; cv=none; b=uOqb3PUOLPXEVRIiv9idFqkV90nWbBVaBs8Xap+ZT56XbfyWLDF2Oh38LVj291V7eFfdpq o4CS0nLSaTlDvsykr06+RFizpkguH0qiTszk/KWeG2+y84aO5PxjtL7mta/UD5fxQoajx9 IDvUBmoqR18hbprg/zn7ixYD0KDG9sCfENWFXZKCtSoqlB2kPR081/mUkNWzsquMVqmzYo TGX9QJv2iTOlgnBGhsIDvIIi6eMBPEqDODfAo0BE4rfks5HDdgXfpsoJDud5WQq1gEzEnf jFq3mTCTYGbDvSErcRP5HQFbxf32GhjmMeIMwDUzlOmqXYSOmkZ4GgvjgEzvDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=073f2076fea4748b457b15dbd1d6e11b802b76f3 commit 073f2076fea4748b457b15dbd1d6e11b802b76f3 Author: Chuck Tuffli AuthorDate: 2022-01-30 07:09:35 +0000 Commit: Chuck Tuffli CommitDate: 2022-01-30 07:09:35 +0000 bhyve nvme: Add Select support to Get Features Implement basic support for the SEL field of Get Features. This returns information about Namespace Specific features. Fixes UNH ILO 16.0 Test 1.2, Case 13 Reviewed by: imp, allanjude Tested by: jason@tubnor.net MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D33574 --- usr.sbin/bhyve/pci_nvme.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 39d1827c2c96..ea3503bdbfc0 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1798,12 +1798,16 @@ nvme_opc_set_features(struct pci_nvme_softc *sc, struct nvme_command *command, return (0); } +#define NVME_FEATURES_SEL_SUPPORTED 0x3 +#define NVME_FEATURES_NS_SPECIFIC (1 << 1) + static int nvme_opc_get_features(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { struct nvme_feature_obj *feat; uint8_t fid = command->cdw10 & 0xFF; + uint8_t sel = (command->cdw10 >> 8) & 0x7; DPRINTF("%s: Feature ID 0x%x (%s)", __func__, fid, nvme_fid_to_name(fid)); @@ -1822,7 +1826,10 @@ nvme_opc_get_features(struct pci_nvme_softc* sc, struct nvme_command* command, } if (compl->status == NVME_SC_SUCCESS) { - compl->cdw0 = feat->cdw11; + if ((sel == NVME_FEATURES_SEL_SUPPORTED) && feat->namespace_specific) + compl->cdw0 = NVME_FEATURES_NS_SPECIFIC; + else + compl->cdw0 = feat->cdw11; } return (0);