From nobody Mon Feb 21 21:58:01 2022 X-Original-To: dev-commits-src-branches@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 EADB219EB4E3; Mon, 21 Feb 2022 21:58:02 +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 4K2blF65Cwz4gl5; Mon, 21 Feb 2022 21:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645480682; 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=gX3LT6Q+rCt2VjpaSNWuv3l4GyuPYZXqAFPP39axN8E=; b=PwDoZlms7Y1Ka0AbnKnbHNrzs8KKlBgnGd1VIhiW1ZzMZDcUwJgsN47ADeCUACAGPlmacM w1wAWSroGuwSOSG63Mbfnu3JNUsMA1rSu14sLIMk8soUe02M3NrgpNjTEuWWYUVBoHtOBv jp0tgeXS557Q9T7k8016nNkw5DAPLf5azPFZx6sxd8UU4/Z88hpIi/HMQ8mTSf7ML3mXNC 61cdR4Iv3WOSC0XsH8sj3bBiyy4Ls8PEh+9cfbHl6ApFxnl/sSoFMZZwKjV2Zfck4hiO5I WQLTJ8vlVhw4J+GWegdaRR8+j52X38d3ybwSSeW+Rafdl8WC2RX6Fmg1gK8u1g== 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 4629C1849D; Mon, 21 Feb 2022 21:58:01 +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 21LLw1v7052214; Mon, 21 Feb 2022 21:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21LLw1vc052213; Mon, 21 Feb 2022 21:58:01 GMT (envelope-from git) Date: Mon, 21 Feb 2022 21:58:01 GMT Message-Id: <202202212158.21LLw1vc052213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chuck Tuffli Subject: git: 3444d620b2a4 - stable/13 - bhyve nvme: Add Select support to Get Features List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3444d620b2a4c7c6eccd5f67b4e7cc2b48a73af9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645480682; 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=gX3LT6Q+rCt2VjpaSNWuv3l4GyuPYZXqAFPP39axN8E=; b=oxh2fXtXGPuQzoxT/Omz0n5A3pjZap2SdR6E7SjKTAbQRC3Mr02Alrnm/VH1uPYHbm0/ZY WwDfM3p/oVwl6O9pBldPeJv8whdtAN7EZ2Y+L1uK/6+7ZZ/iwtq5vI4MdkTGZ/Cf2W8grh pixU4PcxNGiD4vQBWgfcVlthhjP/yC//6IurnLQApWj8R2IE8mNsnkFu8dO8qwwRWRWuEq uaJQ6YXR3aYshlQblqyKZo7YMhR3+64yw0SCs5XhnynNpuOj9r83iGNGrwflUh7zQF2eF5 FcRHgYm/sQ4++rAoAglqw2Xfg5YVmHARqrw6g5b8DvYTdDPV6VjZMfQRoTcTpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645480682; a=rsa-sha256; cv=none; b=hNXbFOX0C9uHL0iO7samMZisZlEctZWopHlXDQ7yyKeQAwey8eNqB/qURvEzRm0ybM6CZU etpwNEloJJacP3iajw8iSfcSSzS1iCgfv+NrADeSZ62/ytIiujHnJbaJwXJE+EFecMlzw9 Wb/FmkT+8YibmGb9WArVZbIPfrffw+aMMW2HJ+Nts7adr7bHdisN8Ica136/7fDjhq5OFd 3kNP89/3RT4Z9OEKR+mtwkoiYPu/d45IvifuVTqOPrWOxUVKCvyDpsWwxotfsrK6DlV3yf fULpXLSUrBEpz4poGK8GOswPBz9LFfcl4ujWZy7IelyXgvwQg807wS7mXa9dfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=3444d620b2a4c7c6eccd5f67b4e7cc2b48a73af9 commit 3444d620b2a4c7c6eccd5f67b4e7cc2b48a73af9 Author: Chuck Tuffli AuthorDate: 2022-01-30 07:09:35 +0000 Commit: Chuck Tuffli CommitDate: 2022-02-22 03:27:14 +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 IOL 16.0 Test 1.2, Case 13 (cherry picked from commit 073f2076fea4748b457b15dbd1d6e11b802b76f3) --- 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 29c5aec4f44c..aff881bd5056 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);