Project

General

Profile

Feature #11184

Want CPU Temperature Sensors

Added by Robert Mustacchi 4 months ago. Updated 4 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:

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

History

#1

Updated by Electric Monk 4 months ago

  • Status changed from New to Closed

git commit f2dbfd322ec9cd157a6e2cd8a53569e718a4b0af

commit  f2dbfd322ec9cd157a6e2cd8a53569e718a4b0af
Author: Robert Mustacchi <rm@joyent.com>
Date:   2019-06-22T01:22:46.000Z

    11184 Want CPU Temperature Sensors
    11185 i86pc chip module should be smatch clean
    Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
    Reviewed by: Jordan Hendricks <jordan.hendricks@joyent.com>
    Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

#2

Updated by Spencer Berger 3 months ago

  • Related to Bug #11332: Regression: 11184 causes kernel hang during boot on CPUs without ARAT added

Also available in: Atom PDF