Date: Sun, 29 Jan 2023 16:59:50 +0000 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=?= Message-ID: <bug-269228-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
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.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269228-227>