From nobody Wed Nov 23 09:44:01 2022 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 4NHGRQ0vjWz4jDBg; Wed, 23 Nov 2022 09:44: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 4NHGRQ0Mmyz4Fjp; Wed, 23 Nov 2022 09:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669196642; 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=vvy9FJlj0lYuXVEF3499Ck+LR5WFnhI59wzFQit/7hw=; b=dme4hkW5h1h4O8Y2yD22yQFpnssDTr9/OePz1GEpKgEZCB8dCFPJPG/rdPwvS2AKhip1va t1iN5vwK2XJmjyDp2oOagjEL5Dur349WizjocOqMk6McRxVAAyUxw9H9Q09bz/VlqntBtp jGmMvAYgYuEf5fTFWrpZ1BFY9Fu8/Nee9Y8ZZDoxcR3xQ865A6aDErBY3YUfswqY2fzNZw I75ARS6/XymJ26KIWUgEHsQSPyV8eExygd1VBRbczp2gqOL3t9OHlz53fNDaRoP9mTV3Hp nfEHLu5Sg19pgEmLuIsDuBv0Kjpg/ykD/VZxnmzkFMmhCw3G0R4eM9w5AXnASw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669196642; 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=vvy9FJlj0lYuXVEF3499Ck+LR5WFnhI59wzFQit/7hw=; b=NPzNwWiMMOFccB4aXVRFj1amawPqgLw7U2YU/4HtK9AsKKOOvjDbRyaCkwpqAXRAakLJ69 pftHhuzZtfM3jQmaGSahxglS7B4kPPRCSDWd/PDaPMgPnhG0CpkgcllfqESgl5xYo0J8RP 0QKWBMkUfR+CeMaOgFdpptyu2A3gU/gpBdNnSFKNz8Ir74wirZCLmfIJIaB+XFuaK3d4nO xqdjWiYfVBQHFFK6vIkE1E+DSvXbL+SPkIUJD7jW9N3wp8Skp9p2C6QHY+zeWuRI+3D9/3 ke2zjRMwLDKf7McBRlaFZAk/v2q6HbojBBCIUHjqK3dmHZ55jHTuhzHiwJUcqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669196642; a=rsa-sha256; cv=none; b=XGtV4nClOCIkdFyovjqNQqdJ/lM8TsQIV8fpmmadzOk5GjwAdbMi1FhxyFQ7kqeHabIw4X ZSFW3Twmcr+KuOcfGLU2OXsQQgSiXV0bQFHz8hKKRBJWqZgY35zePUc5pMJUI8Kd7loflU I4K58/AboFDf3aMxQUjuORib9mPemfbewk1mdnxx1C9JaRMil5Bhes3AHFF+J8UyRvL0eq PRgVWE5i0IDSrQAM8mgAEEexgX9oIHEnuM//P0oFeBvwkaIO/Z1DTCI/3lU6OZu0Ek+CJz Kd6eNbzGq1UN+rLPMDz/3PzBq8NZ6V0w2pN47Lz759MrFUNjLVyiB+4N6kUeuw== 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 4NHGRP6WpHzJDZ; Wed, 23 Nov 2022 09:44: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 2AN9i1KQ015711; Wed, 23 Nov 2022 09:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AN9i1Sn015710; Wed, 23 Nov 2022 09:44:01 GMT (envelope-from git) Date: Wed, 23 Nov 2022 09:44:01 GMT Message-Id: <202211230944.2AN9i1Sn015710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: c18ebe522814 - stable/13 - bhyve: nvme controller obey async event setting when reporting critical temperature 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c18ebe522814dd0ec9eee35fd123847cbf3a95ce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=c18ebe522814dd0ec9eee35fd123847cbf3a95ce commit c18ebe522814dd0ec9eee35fd123847cbf3a95ce Author: Wanpeng Qian AuthorDate: 2022-11-14 13:08:52 +0000 Commit: Corvin Köhne CommitDate: 2022-11-22 06:51:26 +0000 bhyve: nvme controller obey async event setting when reporting critical temperature Async event report is controlled by async event configuration feature setting. When reporting a critical temperature warning, check the async event configuration. Approved by: manu (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37355 (cherry picked from commit 10846c53c4569bdf6d6e2b88739a56a8273bce7f) --- usr.sbin/bhyve/pci_nvme.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 6004cc91707b..46839078e89d 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1726,6 +1726,7 @@ nvme_feature_temperature(struct pci_nvme_softc *sc, uint8_t tmpsel; /* Threshold Temperature Select */ uint8_t thsel; /* Threshold Type Select */ bool set_crit = false; + bool report_crit; tmpth = command->cdw11 & 0xffff; tmpsel = (command->cdw11 >> 16) & 0xf; @@ -1753,11 +1754,13 @@ nvme_feature_temperature(struct pci_nvme_softc *sc, ~NVME_CRIT_WARN_ST_TEMPERATURE; pthread_mutex_unlock(&sc->mtx); - if (set_crit) + report_crit = sc->feat[NVME_FEAT_ASYNC_EVENT_CONFIGURATION].cdw11 & + NVME_CRIT_WARN_ST_TEMPERATURE; + + if (set_crit && report_crit) pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_SMART, sc->health_log.critical_warning); - DPRINTF("%s: set_crit=%c critical_warning=%#x status=%#x", __func__, set_crit ? 'T':'F', sc->health_log.critical_warning, compl->status); }