From nobody Fri Nov 04 09:14: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 4N3ZgY65tqz4hWDZ; Fri, 4 Nov 2022 09:14:01 +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 4N3ZgY5bx3z3Vb6; Fri, 4 Nov 2022 09:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667553241; 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=Pu7z+WTfNI6K7s2jbTmkQgSMXLp9zYtKap9zW8ObktM=; b=YHre2IRrkOWempDUlBhl1TEsc4cDVIroGVte/ysIVwDiEQRNPnCjC/2i2WAra1rOPfxKHG FVXxszFyT4jFcHdiUpJXaFFCAZpDF+YzGbEXLFv5TuWw3VejjI9MD3+ZJ9cVLfOtHDO3ES qWsKMD3agqcHOOpV6mbQDxDuN02ecHIhwbAYAg4rtN7ney12E0RXvoeS4FHwy4Z21jmmIV EAWI/To7vsYOoJ69F9eIakYjaPV0IrF0x9/kifu3gcG0MIfHvZSuXYqDyudS2Us3Q1Ce+X zxQ3okAUYcG+keNDJAkYuxq+V95Wj7DLIVlCnRSRRhVhFE+Bp7b5DpkGmMVGBw== 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 4N3ZgY4bJvz19f3; Fri, 4 Nov 2022 09:14: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 2A49E16g072002; Fri, 4 Nov 2022 09:14:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A49E1qm072001; Fri, 4 Nov 2022 09:14:01 GMT (envelope-from git) Date: Fri, 4 Nov 2022 09:14:01 GMT Message-Id: <202211040914.2A49E1qm072001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: b631954ff079 - main - bhyve: initial PowerCycles value 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/main X-Git-Reftype: branch X-Git-Commit: b631954ff07989b83378bf5cd1af5fad7162c9f9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667553241; 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=Pu7z+WTfNI6K7s2jbTmkQgSMXLp9zYtKap9zW8ObktM=; b=wMI1x1XB/NPZ9WjVGMR7SSWs0zibG7zXXGDqnCjcopYGCp9uIiNLiGvi36HR0+pvIAJJMC ai4uf69daVf+GtnIx6c/anvx6V01tPeHmRp77uAKwywG5EyJNExO8FPXazVznHGKsYTEtx bGGZiTMnZVGYBQgF4gdFb3T2kiGWVVcF5Li1j+6KorTyZ2LovCORaQ2DwuZvlyswSW4s1x goUMpRmbXPXCGeg+RLDrwGAQgN5dtMHSDiFUBD5H/70prZ2DGC/WkDmngRVhzMSuZsWQNL Gcb0m34Wj+pXOw4d86zHWaSYvfa5iIhgCQOgusWTCY+M377VQBrmfIXLb7gIJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667553241; a=rsa-sha256; cv=none; b=fxdYYLk3xrwxZ3drkJBILpN17fARdL98rfiZsZVkrPr+jdSsmgtXa3LKJNDIZz0ZEzRe/Y G+wlYFj7+z5KQ7T4U/RU7CKxBR6Rh5tRXtn3RkuVT9ukThMK4s4P9zIS0pF91LaCpqV9ad Kfh0zFhlD7At2LC8DB+kjc1I68fmfNhHb5GzEn2PMpoDaOBgnqg/3/ZeIA1yqAqYA9mssh 0G7NdauXhCRnZfxFg+uPrRIAV4Z23t0ytHtijW9TfEc6g6y2QrydLt3yI84wN4jd3xldQ8 jgDvWW5ndQENmJ/ntR7GUKdAm7NlyHByxxT2TqT5VUdK/vjbV8BLLwz26BmB8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=b631954ff07989b83378bf5cd1af5fad7162c9f9 commit b631954ff07989b83378bf5cd1af5fad7162c9f9 Author: Wanpeng Qian AuthorDate: 2022-11-04 07:48:00 +0000 Commit: Corvin Köhne CommitDate: 2022-11-04 09:13:01 +0000 bhyve: initial PowerCycles value Currently PowerCycles field of Log Page is 0 and it is an invalid value. This patch will initial the PowerCycles data to 1. MFC after: 1 week Approved by: manu (mentor) Reviewed By: grehan (older version), chuck, corvink Differential Revision: https://reviews.freebsd.org/D32558 --- usr.sbin/bhyve/pci_nvme.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 01b7649642a8..b341b70f4e48 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -688,6 +688,7 @@ pci_nvme_init_nsdata(struct pci_nvme_softc *sc, static void pci_nvme_init_logpages(struct pci_nvme_softc *sc) { + __uint128_t power_cycles = 1; memset(&sc->err_log, 0, sizeof(sc->err_log)); memset(&sc->health_log, 0, sizeof(sc->health_log)); @@ -707,6 +708,9 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc) sc->fw_log.afi = (1 << NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT); memcpy(&sc->fw_log.revision[0], sc->ctrldata.fr, sizeof(sc->fw_log.revision[0])); + + memcpy(&sc->health_log.power_cycles, &power_cycles, + sizeof(sc->health_log.power_cycles)); } static void