From nobody Mon Aug 26 18:03:19 2024 X-Original-To: dev-commits-src-all@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 4Wsz7C6Ndyz5TMDK; Mon, 26 Aug 2024 18:03:19 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsz7C40JQz450B; Mon, 26 Aug 2024 18:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695399; 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=Tqa53fkhFHOXEsJDVf3d9d2j3nYimfvdF4WbvwAl3yk=; b=OlUfXhtjdz56OB9dSRMdYUMiaE3pBFIs1aP2wGOoBCo1vdzUdF8kme14YYlcft0UJysZlD plzzH8zKBysreV6jTsk38DAEuMRovlTpmD1SXs/3pjBCoeUiVb6zsA/Av1q69PysQV986A LHC1x1dnFEAb5IkpOPA69RLTfVMor8Virvoje5ZYDdpUvsuNNsWSYE4PxCAenbi5fsEBZy UqGtkSWakOWDLCFQQd75Ynwh/VQ/Se6GN0yO/5BAHiG6MmK4DfHR9NwFIQ2FULtp6Qzz7P n0PBqI0t0oQOLc79Z/nb9c8OSoVDgEB7T5qvh43kqAyJxf+X+upvt/yPpkqezw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695399; a=rsa-sha256; cv=none; b=N/jolT0GMJLFtZUD3rsRb+TUByOE9AMVQ3Xou9ysyfxGT61jte5ohWAOEP85Y+jeWRoGTl FRro/5A5Vl18qubSByMyCCYEUAL3xXJVdOEK36l6li74JhImvFNH/c7HWMYeRBdw3XhK6j VweZHNJ0vwG1GVN1FtVR8cQ8JPzGI0XPFuQVcdXSYGIxfdLbXQD4Bbw0p5nrcKqsyxqhrZ eTpAFeqFmmAN2L64lC4/uhNgX2MfhysLqYdM39Ouc10QB1Ojzenibi+2CdwIDt2Pn2PFY9 QUvBKz75l7Y2uKIymFsXSw2E+EdeM66Cg5B+6UKRLmLs64EJ1ogiLW8GF5ggNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695399; 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=Tqa53fkhFHOXEsJDVf3d9d2j3nYimfvdF4WbvwAl3yk=; b=UHOxpVZf9LjPI7VE28QLRvrrDtFWL0qSOzdeztsVmycpVDqIKQ/XOdpsLvOFEmJMZH7l1S 0D3qRyXPnqanhGALXM2HhZqJHXV/B/m4r/vG7LNiV/8g9UtSNcAjTEThBoMsYNzmTyMHg+ OpVxhphF7M8YIDAv/DUh3UZXTVOliKk+LjOEkRHu+uFx/uI9Yjxi8ZOlR+00s0CWGc2bAG OyuYy+rwx/LhBlE/gUO5p4lp4qp2lA69Z/4DapBykCFHGq6YWjXJnOX2TVDJuLJflB+ri/ Ihqygd+K5DJYisTfilRTtnFiX25j4zdw//uwWE6JYwg467o1K/FLaMg90zNPLA== 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 4Wsz7C3cR4zGsB; Mon, 26 Aug 2024 18:03:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QI3JxP042729; Mon, 26 Aug 2024 18:03:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3JpU042726; Mon, 26 Aug 2024 18:03:19 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:19 GMT Message-Id: <202408261803.47QI3JpU042726@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8029ffc9c0b8 - stable/14 - bhyve: Use the NVMEM macro instead of expanded versions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8029ffc9c0b895b783da8ba366ffdcc9e4862e64 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8029ffc9c0b895b783da8ba366ffdcc9e4862e64 commit 8029ffc9c0b895b783da8ba366ffdcc9e4862e64 Author: John Baldwin AuthorDate: 2024-01-29 19:00:09 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:54 +0000 bhyve: Use the NVMEM macro instead of expanded versions Reviewed by: corvink, chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43603 (cherry picked from commit c85b3903d1b1cf93f1fba10cd1cffed31ce84418) --- usr.sbin/bhyve/pci_nvme.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 2d426fb19096..cd81767d950b 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -380,14 +380,14 @@ static void pci_nvme_io_done(struct blockif_req *, int); NVMEV(NVME_CC_REG_IOCQES, cc) #define NVME_CC_WRITE_MASK \ - ((NVME_CC_REG_EN_MASK << NVME_CC_REG_EN_SHIFT) | \ - (NVME_CC_REG_IOSQES_MASK << NVME_CC_REG_IOSQES_SHIFT) | \ - (NVME_CC_REG_IOCQES_MASK << NVME_CC_REG_IOCQES_SHIFT)) + (NVMEM(NVME_CC_REG_EN) | \ + NVMEM(NVME_CC_REG_IOSQES) | \ + NVMEM(NVME_CC_REG_IOCQES)) #define NVME_CC_NEN_WRITE_MASK \ - ((NVME_CC_REG_CSS_MASK << NVME_CC_REG_CSS_SHIFT) | \ - (NVME_CC_REG_MPS_MASK << NVME_CC_REG_MPS_SHIFT) | \ - (NVME_CC_REG_AMS_MASK << NVME_CC_REG_AMS_SHIFT)) + (NVMEM(NVME_CC_REG_CSS) | \ + NVMEM(NVME_CC_REG_MPS) | \ + NVMEM(NVME_CC_REG_AMS)) /* Controller Status utils */ #define NVME_CSTS_GET_RDY(sts) \ @@ -399,11 +399,10 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Completion Queue status word utils */ #define NVME_STATUS_P (1 << NVME_STATUS_P_SHIFT) #define NVME_STATUS_MASK \ - ((NVME_STATUS_SCT_MASK << NVME_STATUS_SCT_SHIFT) |\ - (NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT)) + (NVMEM(NVME_STATUS_SCT) | \ + NVMEM(NVME_STATUS_SC)) -#define NVME_ONCS_DSM (NVME_CTRLR_DATA_ONCS_DSM_MASK << \ - NVME_CTRLR_DATA_ONCS_DSM_SHIFT) +#define NVME_ONCS_DSM NVMEM(NVME_CTRLR_DATA_ONCS_DSM) static void nvme_feature_invalid_cb(struct pci_nvme_softc *, struct nvme_feature_obj *, @@ -580,8 +579,7 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) break; } - cd->fna = NVME_CTRLR_DATA_FNA_FORMAT_ALL_MASK << - NVME_CTRLR_DATA_FNA_FORMAT_ALL_SHIFT; + cd->fna = NVMEM(NVME_CTRLR_DATA_FNA_FORMAT_ALL); cd->vwc = NVME_CTRLR_DATA_VWC_ALL_NO << NVME_CTRLR_DATA_VWC_ALL_SHIFT; @@ -2732,8 +2730,7 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint16_t idx) if ((nsid == 0) || (nsid > sc->ctrldata.nn)) { pci_nvme_status_genc(&status, NVME_SC_INVALID_NAMESPACE_OR_FORMAT); - status |= - NVME_STATUS_DNR_MASK << NVME_STATUS_DNR_SHIFT; + status |= NVMEM(NVME_STATUS_DNR); goto complete; } @@ -2957,8 +2954,7 @@ pci_nvme_write_bar_0(struct pci_nvme_softc *sc, uint64_t offset, int size, if (NVME_CC_GET_SHN(ccreg)) { /* perform shutdown - flush out data to backend */ - sc->regs.csts &= ~(NVME_CSTS_REG_SHST_MASK << - NVME_CSTS_REG_SHST_SHIFT); + sc->regs.csts &= ~NVMEM(NVME_CSTS_REG_SHST); sc->regs.csts |= NVME_SHST_COMPLETE << NVME_CSTS_REG_SHST_SHIFT; }