Project

General

Profile

Actions

Feature #11184

closed

Want CPU Temperature Sensors

Added by Robert Mustacchi over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Both Intel and AMD support means to have temperature sensors for the cores and packages that exist. It'd be nice if we could have a driver that covered AMD Family 17h and recent Intel processors. On Intel processors we have a per-core sensor and a per-chip sensor when available. On AMD F17h systems, the sensor exists on a per-die basis. As part of this, we'll begin a somewhat generic sensor framework to give us building blocks for the future.

To test this, I did a number of various things:

  • I used ctfdump to compare the 32-bit user/ 64-bit kernel sizes of the ioctl structures to verify that they are the same size (therefore copyout won't overrun a user bufer)
  • I tested this on a number of hardware systems that have IPMI and compared the values we had with those that IPMI reported and found we were generally within a degree of what it measured
  • Verified that we have the files in /dev/sensor that we expect on the following Intel / AMD platforms:
  • * Ivy Bridge (client), which only has the core and not package sensors
  • * Haswell (client), which has core and package sensors
  • * Skylake (server), which has core and package sensors
  • * Coffee Lake (client), which has core and package sensors
  • * AMD EPYC (server)
  • * AMD Threadripper (client)
  • Manually verified that we had the right offsets detected for Threadripper systems

Here's an example of what a sensor looks like on an AMD Ryzen system from fmtopo:

hc://:product-id=AS--2023US-TR4:server-id=odyssey:chassis-id=S268672X7C09080/motherboard=0/chip=1/core=2?sensor=temp
  group: protocol                       version: 1   stability: Private/Private
    resource          fmri      hc://:product-id=AS--2023US-TR4:server-id=odyssey:chassis-id=S268672X7C09080/motherboard=0/chip=1/core=2?sensor=temp
  group: authority                      version: 1   stability: Private/Private
    product-id        string    AS--2023US-TR4
    chassis-id        string    S268672X7C09080
    server-id         string    odyssey
  group: facility                       version: 1   stability: Private/Private
    sensor-class      string    threshold
    type              uint32    0x1 (TEMP)
    units             uint32    0x1 (DEGREES_C)
    reading           double    38.500000

Related issues

Related to illumos gate - Bug #11332: Regression: 11184 causes kernel hang during boot on CPUs without ARATClosed

Actions
Related to illumos gate - Feature #12954: Rewrite coretemp to use the ksensor frameworkClosedRobert Mustacchi

Actions
Actions

Also available in: Atom PDF