From nobody Sun Jan 29 16:59:50 2023 X-Original-To: bugs@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 4P4cxM00Ndz3bGw8 for ; Sun, 29 Jan 2023 16:59:51 +0000 (UTC) (envelope-from bugzilla-noreply@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 4P4cxL4rqgz4VCq for ; Sun, 29 Jan 2023 16:59:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675011590; 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=1nCiHYX01X5xEsdrOHO3juKSnDwiICfaPB28zkSQO1U=; b=K00nuCETi0MmJ0HBFmyuhdo0coA3lwTP3CTsFCoMM81cZLTX7+Ru1E0RBA4EGx6uL6SJAB M1PMXsur1hdGC5YUm4QdkQiYuu3ppfj8yYavhvyL7NKRcfMcSPJ0ZdUHSQe/RrnV/QvB1d NQ4a1oXN2Z9lNoH1QmZvc9rDFSWTU7IogRnvnJSiPk7EiF/xmC5gBAn9o1tRmUrChb38Kd V9mD40BbkGhkLNDkZKW+unad6gcfj6UqcAcrz5nVXZMQnEBmg65M9tDqP9Ar4EaDoKWqO0 MtCfLiaFykz11nz4SIxgsQCm+zoQB9Rw8L0Qmqp/5RbkAo+BK1D/KIys8vBcXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675011590; a=rsa-sha256; cv=none; b=XUWiMI1cSLmMA9a6YiBLDmuUvZb+0Ui+F23y3HiYbqjL7Y56sMCiow8He9MdgeSmE4ipY1 z6d14CE7vK6HbA1TneePuFVpymPyx2pDM6EPSg93TJnTWTW9nFV2SF4K36lCXcKgK09tQj n0SCTZhv+3/4mDZYVm37Zmv/JM/37mUD9T/SwnMjpZbqvxrA4XlUBivlGQdiPjW/JGs+fZ tA501H3/02Hu+HbqteevIa9mZuhQ1Kd6vNRfOS/n1x5VSp/8G3uAsvJtfnWBlyMgV6zajp LogSVe9rycMWa/We8S5gdRYuUPSGR/leuCTC2fxpqdQLy+ner9StpjE1FQDaTw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4P4cxL3mGhzbYH for ; Sun, 29 Jan 2023 16:59:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 30TGxohw018132 for ; Sun, 29 Jan 2023 16:59:50 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 30TGxowc018130 for bugs@FreeBSD.org; Sun, 29 Jan 2023 16:59:50 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: =?UTF-8?B?W0J1ZyAyNjkyMjhdIGNvcmV0ZW1wOiBpbmNvcnJlY3QgdGptYXgg?= =?UTF-8?B?Zm9yIGRlc2t0b3AgYW5kIHNlcnZlciBDb3JlIDIgRHVvL1hlb24gNTF4eCAy?= =?UTF-8?B?Y29yZXMgNjVubSAoQ29ucm9lLCBXb29kY3Jlc3QsIHBvc3NpYmxlIEFsbGVu?= =?UTF-8?B?ZGFsZSk6IDg1wrBDLCBidXQgbXVzdCBiZSAxMDDCsEM=?= Date: Sun, 29 Jan 2023 16:59:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: vvd@unislabs.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269228 Bug ID: 269228 Summary: coretemp: incorrect tjmax for desktop and server Core 2 Duo/Xeon 51xx 2cores 65nm (Conroe, Woodcrest, possible Allendale): 85=C2=B0C, but must be 100=C2=B0C Product: Base System Version: 13.1-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: vvd@unislabs.com FreeBSD 13.1-p amd64. On some Core 2 Duo and "same" Xeons I found very low temperature. For example 13=C2=B0C on CPU cores in server room with 16=C2=B0C air temper= ature, or 33=C2=B0C on desktop with 28=C2=B0C in room. In same server room Core 2 Quad, Core i7= 920/930, Xeon X3430, Xeon 3104 have temperature from 24 to 50. I started explore. dev.cpu.X.temperature =3D dev.cpu.X.coretemp.tjmax - dev.cpu.X.coretemp.del= ta For other Core 2 Quad Q6600 tjmax =3D 100, but for Core 2 Duo 85 - weird=E2= =80=A6 Check sources: https://cgit.freebsd.org/src/tree/sys/dev/coretemp/coretemp.c if ((cpu_model =3D=3D 0xf && cpu_stepping >=3D 2) || cpu_model =3D= =3D 0xe) { /* * On some Core 2 CPUs, there's an undocumented MSR that * can tell us if Tj(max) is 100 or 85. * * The if-clause for CPUs having the MSR_IA32_EXT_CONFIG was adapted * from the Linux coretemp driver. */ msr =3D rdmsr(MSR_IA32_EXT_CONFIG); if (msr & (1 << 30)) sc->sc_tjmax =3D 85; } else if (cpu_model =3D=3D 0x17) { Open linux driver: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dri= vers/hwmon/coretemp.c /* * Now we can detect the mobile CPU using Intel provided ta= ble * http://softwarecommunity.intel.com/Wiki/Mobility/720.htm * For Core2 cores, check MSR 0x17, bit 28 1 =3D Mobile CPU */ err =3D rdmsr_safe_on_cpu(id, 0x17, &eax, &edx); if (err) { dev_warn(dev, "Unable to access MSR 0x17, assuming deskt= op" " CPU\n"); usemsr_ee =3D 0; } else if (c->x86_model < 0x17 && !(eax & 0x10000000)) { /* * Trust bit 28 up to Penryn, I could not find any * documentation on that; if you happen to know * someone at Intel please ask */ usemsr_ee =3D 0; } else { Look like very different logic - use different MSR. I think FreeBSD's coretemp have incorrect check of tjmax for Conroe. I'll do more test a bit later with Linux and FreeBSD on different CPUs - Co= re 2 Duo E6xxx/E4xxx, Pentium Dual-Core E2xxx, and on Wolfdale Core 2 Duo E7xxx. I want to try, but I can't promise to do this: apply Linux's logic with MSR 0x17 (MSR_IA32_PLATFORM_ID) to coretemp and test it on my hardware. P.S. I hope my poor english won't hurt to understand me=E2=80=A6 --=20 You are receiving this mail because: You are the assignee for the bug.=