From nobody Sun Feb 05 05:08:49 2023 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 4P8cqj3VTFz3ksdL; Sun, 5 Feb 2023 05:08:49 +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 4P8cqj2tTDz4Nk6; Sun, 5 Feb 2023 05:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675573729; 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=xmWwD5q0OjsqFnZX3cDCe+i3UOTvebUcXk2iH7e/XMc=; b=yvac7PUwiSouBmqepxbgF0Isrp6/sS8cGPlPcv1tDVs+3g9Max3ODa0NkQYKmXX1l9FfQc VVH/hkmvLkkx6R3f6caDFUQHMMJ1hQZwLimMUfH9yz5le2HysVZkVEvCxPWNGD6/FPJcKT kzTVL8/YCXaHu/BgLmcw+L099ui0cQpeqdf6/yS+NLFZ22BQ7aEgE2fqPMB5pMWn2OaPma i6qKgNqoV0z1h90F2LEAbozpksMCpuuPxLhnXNl2XMrI/a3pIzW6/ZY9cIfrbn+sUgnDth /ndpjCAmHaOcTAp4Ju18Rl52xJ0Df3Z7oWTajM2nbSdaU62exdVoNcJJLjTHFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675573729; 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=xmWwD5q0OjsqFnZX3cDCe+i3UOTvebUcXk2iH7e/XMc=; b=JlyDYbofBY0p8zcgAliFRZxaLU09YyqrsK1SotbGA1/N1lPBOQu7KL/6P4oewjHcHwOcPc h/UhzNE/xqiHX+ZomChxM6Ki3euiv33b94wia+36YNmUf/PAo2+/qBUeDXoe9qo6bEQAzj T9UtvUbqeG1uE3xrPePtVXahIOAzk2BhYjCGH/A1fMdK9YaF+j6TWBptznDyh6SWCLa98s knSlesgdSW58xOhbDzM/X3H/FJfF9QxwV7kFP340pIiSBZcWTmpYT65bo3hcTqvNLfOHU2 q8q1ExFQDGPrhiPAfsLnzzufY5wp8YRgZaU2XhnmkCcaAPMlfn8TToP0Fptgzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675573729; a=rsa-sha256; cv=none; b=bKK7UNWbtkHyObcI9ANWRUXm6pzvEoUTfwSUxn1rN37smu5ZOuzO9OQSTjz5pHgaER8eAG reQgpA9PWtQsS+DXyZT7A2eREtpWXKjydaOYHFJ2SeQJHp9WP+AQQhp/YLpSrNwuZIj6fv XoDjOMG7/BdyEj6vD4mJtqQ0LLP5oiCFvjWHwP01owAoJb4CHvNEdVyf2VIEdo5GNbzwwq PXqT4xHop8d8lW3fvzA/SMkz4Hpkri3js1JzKaSM7FITaOqmJCWkwafL0XuKZ3vBQNi8R4 hiovLX60IzQZriCevQ1yLbkWwByyoTuLw2SkzXbejtgPejuDWBE2Niz65HOpsA== 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 4P8cqj1vvszjRR; Sun, 5 Feb 2023 05:08:49 +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 31558naN002089; Sun, 5 Feb 2023 05:08:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31558nGE002088; Sun, 5 Feb 2023 05:08:49 GMT (envelope-from git) Date: Sun, 5 Feb 2023 05:08:49 GMT Message-Id: <202302050508.31558nGE002088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8362905cb69e - main - coretemp: Only log critical temperature events 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8362905cb69e06b8946dd582ce2c1fb67d86081a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8362905cb69e06b8946dd582ce2c1fb67d86081a commit 8362905cb69e06b8946dd582ce2c1fb67d86081a Author: sadaszewski AuthorDate: 2021-11-17 07:27:46 +0000 Commit: Warner Losh CommitDate: 2023-02-05 05:05:48 +0000 coretemp: Only log critical temperature events According to the Intel manual https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3b-part-2-manual.pdf the Thermal Status (0) and Thermal Status Log (1) bits report only a high temperature on the CPU, not a critical temperature as suggested in the coretemp driver. Check the Critical Temperature Log (5) instead. The critical temperature waives guarantees of correct function, therefore the CPU could have for example written some wrong values into memory at that point and the OS should be stopped ASAP as the state is no longer reliable. Reviewed by: imp (confirmed descriptions of bits, linux ignores these bits) Pull Request: https://github.com/freebsd/freebsd-src/pull/562 --- sys/dev/coretemp/coretemp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/coretemp/coretemp.c b/sys/dev/coretemp/coretemp.c index c81eb8371413..d8a67f257110 100644 --- a/sys/dev/coretemp/coretemp.c +++ b/sys/dev/coretemp/coretemp.c @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); #define TZ_ZEROC 2731 +#define THERM_CRITICAL_STATUS_LOG 0x20 +#define THERM_CRITICAL_STATUS 0x10 #define THERM_STATUS_LOG 0x02 #define THERM_STATUS 0x01 #define THERM_STATUS_TEMP_SHIFT 16 @@ -393,7 +395,7 @@ coretemp_get_val_sysctl(SYSCTL_HANDLER_ARGS) * If we reach a critical level, allow devctl(4) * to catch this and shutdown the system. */ - if (msr & THERM_STATUS) { + if (msr & THERM_CRITICAL_STATUS) { tmp = (msr >> THERM_STATUS_TEMP_SHIFT) & THERM_STATUS_TEMP_MASK; tmp = (sc->sc_tjmax - tmp) * 10 + TZ_ZEROC;