Skip to contentSkip to conversation

platform/x86/amd/hsmp: Unify per-socket sysfs metrics

PATCH New Erwan Velu 1 participant 6 messages Nov 16

Subsystems (4)
lore
Share & tools
lore

Erwan Velu

author
#0 lore raw

v2 cover platform/x86/amd/hsmp: Unify per-socket sysfs metrics

From: Erwan Velu <[email protected]>

The goal of this series is to ease server monitoring, by exposing the HSMP metrics the same way whatever the driver, in a format that is straightforward to integrate in metrics exporters.

The per-socket HSMP telemetry attributes (c0_residency_input, ddr_max_bw, pwr_current_active_freq_limit, ...) are only implemented by the ACPI driver, although they are plain HSMP messages the platform driver can send as well. Systems probed by the platform driver therefore only get metrics_bin.

Their location also depends on the driver: AMDI0097:0X with the ACPI driver, amd_hsmp/socketN with the platform one. "modprobe amd_hsmp" picks the right driver, but userspace cannot know in advance which tree it has to read.

This series moves the attributes to common code and adds an amd_hsmp class with one socketN device per socket, registered by both drivers. /sys/class/amd_hsmp/socketN/ is then the same path whichever driver probed. The existing ACPI and platform sysfs paths keep working.

Patch 1 is a pure code move. Patch 2 adds the class and wires it in the ACPI driver, patch 3 does the same for the platform driver. Patch 4 exposes the pwr_current_active_freq_limit_source bitmask as a single hexadecimal value, whose interpretation can be centralized in the monitoring stack (e.g. Grafana value mappings). Patch 5 documents /sys/class/amd_hsmp in Documentation/ABI/testing.

This v2 reworks patches 2 and 3 following Carlos' review of v1, and is meant as a basis for discussion: I would rather know early whether this is heading in the right direction, in particular for the class approach and the AMDI0097:0X ABI question raised in the v1 thread, before polishing it further.

Changes in v2:
- Replace the separate /sys/devices/amd_hsmp tree, its root device and its hand-rolled refcount by an amd_hsmp class, as suggested by Carlos. The kref.h remark from Ilpo no longer applies, as there is no shared object to refcount anymore.
- Platform driver: the socket devices replace the bare socketN attribute groups. As class devices land in an amd_hsmp glue directory below their parent, a socketN symlink keeps the existing /sys/devices/platform/amd_hsmp/socketN/metrics_bin path working.
- New patch 5: Documentation/ABI/testing/sysfs-class-amd_hsmp. Its content depends on the AMDI0097:0X ABI discussion with Carlos in the v1 thread, and can be dropped or reworked accordingly.
- Collected Acked-by from Carlos on patches 1 and 4.
- Rebased on v7.4-rc3.

Tested on a Zen4 (Family 19h, HSMP protocol 5) server with the platform driver, and on a dual socket Zen5 (Family 1Ah) server with the ACPI
driver: attributes read through /sys/class/amd_hsmp, legacy paths still working, and 20 unload/reload cycles of the driver while reading the attributes in a loop.

v1: https://lore.kernel.org/platform-driver-x86/[email protected]/

Erwan Velu (5):
platform/x86/amd/hsmp: Move per-socket sysfs attributes to common code platform/x86/amd/hsmp: Add amd_hsmp class with per-socket devices platform/x86/amd/hsmp: Expose socket attributes from the platform
driver
platform/x86/amd/hsmp: Add pwr_current_active_freq_limit_source_raw Documentation/ABI: Add sysfs-class-amd_hsmp

 .../ABI/testing/sysfs-class-amd_hsmp          | 120 +++++
 Documentation/arch/x86/amd_hsmp.rst           |  24 +-
 MAINTAINERS                                   |   1 +
 drivers/platform/x86/amd/hsmp/Makefile        |   2 +-
 drivers/platform/x86/amd/hsmp/acpi.c          | 345 +-------------
 drivers/platform/x86/amd/hsmp/hsmp.c          |  19 +
 drivers/platform/x86/amd/hsmp/hsmp.h          |   8 +
 drivers/platform/x86/amd/hsmp/plat.c          | 155 +++----
 drivers/platform/x86/amd/hsmp/sysfs.c         | 435 ++++++++++++++++++
 9 files changed, 681 insertions(+), 428 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-amd_hsmp
 create mode 100644 drivers/platform/x86/amd/hsmp/sysfs.c

base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3

Signature · 1 line
2.53.0
author
#1 lore raw

PATCH v2 1/5 platform/x86/amd/hsmp: Move per-socket sysfs attributes to common code

From: Erwan Velu <[email protected]>

The per-socket telemetry attributes (c0_residency_input, ddr_max_bw, pwr_current_active_freq_limit, ...) are implemented in acpi.c, so only the ACPI driver can expose them, although they are plain HSMP messages the platform driver can send as well.

Move them to a new sysfs.c in hsmp_common and export the attribute groups as hsmp_sock_groups, so they can be shared by both drivers. The ACPI driver keeps exposing them on its socket devices via dev_groups.

No functional change.

Assisted-by claude-opus-5-5
---
 drivers/platform/x86/amd/hsmp/Makefile |   2 +-
 drivers/platform/x86/amd/hsmp/acpi.c   | 331 +----------------------
 drivers/platform/x86/amd/hsmp/hsmp.h   |   1 +
 drivers/platform/x86/amd/hsmp/sysfs.c  | 348 +++++++++++++++++++++++++
 4 files changed, 351 insertions(+), 331 deletions(-)
 create mode 100644 drivers/platform/x86/amd/hsmp/sysfs.c
drivers/platform/x86/amd/hsmp/Makefile +1 -1
index ce8342e71f50..21fc1d185550 100644
@@ -5,7 +5,7 @@
 #
 
 obj-$(CONFIG_AMD_HSMP)			+= hsmp_common.o
-hsmp_common-y				:= hsmp.o
+hsmp_common-y				:= hsmp.o sysfs.o
 hsmp_common-$(CONFIG_HWMON)		+= hwmon.o
 obj-$(CONFIG_AMD_HSMP_PLAT)		+= amd_hsmp.o
 amd_hsmp-y				:= plat.o
drivers/platform/x86/amd/hsmp/acpi.c +1 -330

367 lines not on this page · raw message

drivers/platform/x86/amd/hsmp/hsmp.h +1 -0
index 3302c1517369..7a0e3af67691 100644
@@ -104,6 +104,7 @@ int hsmp_create_sensor(struct device *dev, u16 sock_ind);
 static inline int hsmp_create_sensor(struct device *dev, u16 sock_ind) { return 0; }
 #endif
 int hsmp_msg_get_nargs(u16 sock_ind, u32 msg_id, u32 *data, u8 num_args);
+extern const struct attribute_group *hsmp_sock_groups[];
 
 /*
  * Gates the HSMP data plane: hsmp_send_message() takes it for read; probe and
drivers/platform/x86/amd/hsmp/sysfs.c new file +348 -0

348 lines not on this page · raw message

base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3

Signature · 1 line
2.53.0
author
#2 lore raw

PATCH v2 2/5 platform/x86/amd/hsmp: Add amd_hsmp class with per-socket devices

In reply to Erwan Velu

From: Erwan Velu <[email protected]>

The per-socket attributes live in different places depending on the driver that probed. With the ACPI driver, they are under /sys/devices/platform/AMDI0097:0X/. With the platform driver, the per-socket directories are /sys/devices/platform/amd_hsmp/socketN/. "modprobe amd_hsmp" picks the right driver, but userspace cannot know in advance which of these trees it has to read.

Add an amd_hsmp class, and a socketN device per socket in it that carries hsmp_sock_groups. The device is a child of the device of the driver that probed the socket, so /sys/class/amd_hsmp/socketN/ is the same path whichever driver is in use.

Register the socket devices from the ACPI driver. They are children of the AMDI0097:0X devices. The attributes on AMDI0097:0X are kept, as they are documented.

The socket device is unregistered before remove takes hsmp_sock_rwsem:
device_unregister() waits for in-flight sysfs reads, which take the rwsem for read.

On a dual socket Zen5 (Family 1Ah) server probed by the ACPI driver, this gives:

  $ ls -l /sys/class/amd_hsmp/
  socket0 -> ../../devices/platform/AMDI0097:00/amd_hsmp/socket0
  socket1 -> ../../devices/platform/AMDI0097:01/amd_hsmp/socket1
  $ cat /sys/class/amd_hsmp/socket0/pwr_current_active_freq_limit
  3120

The amd_hsmp directory below AMDI0097:0X is the glue directory the driver core creates for class devices whose parent is not a class device. The attributes directly under AMDI0097:0X are unchanged.

Assisted-by claude-opus-5-5
---
 Documentation/arch/x86/amd_hsmp.rst   | 12 ++++-
 drivers/platform/x86/amd/hsmp/acpi.c  | 14 ++++++
 drivers/platform/x86/amd/hsmp/hsmp.c  | 19 +++++++
 drivers/platform/x86/amd/hsmp/hsmp.h  |  6 +++
 drivers/platform/x86/amd/hsmp/sysfs.c | 71 ++++++++++++++++++++++++++-
 5 files changed, 120 insertions(+), 2 deletions(-)
Documentation/arch/x86/amd_hsmp.rst +11 -1
index c483c68dcfad..f145ea12af99 100644
@@ -65,6 +65,16 @@ In-kernel integration:
 HSMP sysfs interface
 ====================
 
+Each socket has a socket%d device in the amd_hsmp class, whose parent is the
+device of the driver that probed the socket. Its per socket sysfs files are
+therefore available at /sys/class/amd_hsmp/socket%d/, whichever driver
+probed.
+
+With the ACPI driver, the socket devices are children of the ACPI devices,
+e.g. /sys/devices/platform/AMDI0097:00/amd_hsmp/socket0/. For backward
+compatibility, the files are also available directly under
+/sys/devices/platform/AMDI0097:0X/.
+
 1. Metrics table binary sysfs
 
 AMD MI300A MCM provides GET_METRICS_TABLE message to retrieve
@@ -88,7 +98,7 @@ The same is defined in the amd_hsmp.h header.
 
 2. HSMP telemetry sysfs files
 
-Following sysfs files are available at /sys/devices/platform/AMDI0097:0X/.
+Following sysfs files are available at /sys/class/amd_hsmp/socket%d/.
 
 * c0_residency_input: Percentage of cores in C0 state.
 * prochot_status: Reports 1 if the processor is at thermal threshold value,
drivers/platform/x86/amd/hsmp/acpi.c +14 -0
index a1e13aff9c86..2c9389b8f139 100644
@@ -452,6 +452,14 @@ static int hsmp_acpi_probe(struct platform_device *pdev)
 		dev_dbg(&pdev->dev, "AMD HSMP ACPI misc device registered\n");
 	}
 
+	/*
+	 * The attributes stay available on the ACPI device itself, so a
+	 * failure here is not fatal to the probe.
+	 */
+	ret = hsmp_sock_dev_register(&pdev->dev, dev_get_drvdata(&pdev->dev));
+	if (ret)
+		dev_warn(&pdev->dev, "Failed to register HSMP socket device: %d\n", ret);
+
 	return 0;
 }
 
@@ -459,6 +467,12 @@ static void hsmp_acpi_remove(struct platform_device *pdev)
 {
 	struct hsmp_socket *sock = dev_get_drvdata(&pdev->dev);
 
+	/*
+	 * Must run before taking hsmp_sock_rwsem below: unregistering the
+	 * class device waits for in-flight sysfs reads, which take it for read.
+	 */
+	hsmp_sock_dev_unregister(sock);
+
 	/*
 	 * Serialize the kref_put() and any release it triggers against a
 	 * concurrent probe, and drain the data plane for the whole
drivers/platform/x86/amd/hsmp/hsmp.c +19 -0
index 45d20beda946..a498f904f900 100644
@@ -16,7 +16,9 @@
 #include <linux/compiler.h>
 #include <linux/delay.h>
 #include <linux/device.h>
+#include <linux/init.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/nospec.h>
 #include <linux/rwsem.h>
@@ -857,6 +859,23 @@ struct hsmp_plat_device *get_hsmp_pdev(void)
 }
 EXPORT_SYMBOL_NS_GPL(get_hsmp_pdev, "AMD_HSMP");
 
+/*
+ * The amd_hsmp class must exist before the ACPI or platform driver probes a
+ * socket. When built in, subsys_initcall() runs it ahead of their
+ * device_initcall()s.
+ */
+static int __init hsmp_common_init(void)
+{
+	return hsmp_sock_class_register();
+}
+subsys_initcall(hsmp_common_init);
+
+static void __exit hsmp_common_exit(void)
+{
+	hsmp_sock_class_unregister();
+}
+module_exit(hsmp_common_exit);
+
 MODULE_DESCRIPTION("AMD HSMP Common driver");
 MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE("GPL");
drivers/platform/x86/amd/hsmp/hsmp.h +6 -0
index 7a0e3af67691..35b4e2312bf2 100644
@@ -32,6 +32,7 @@
 
 #define HSMP_CDEV_NAME		"hsmp_cdev"
 #define HSMP_DEVNODE_NAME	"hsmp"
+#define HSMP_CLASS_NAME		"amd_hsmp"
 #define ACPI_HSMP_DEVICE_HID    "AMDI0097"
 
 #define DRIVER_VERSION		"2.6"
@@ -71,6 +72,7 @@ struct hsmp_socket {
 	/* Size of the region mapped at @metric_tbl_addr, as reported by SMU */
 	size_t metric_tbl_size;
 	void __iomem *virt_base_addr;
+	struct device *sysfs_dev;
 	struct semaphore hsmp_sem;
 	/* Serializes HSMP_GET_METRIC_TABLE fill-and-copy for this socket */
 	struct mutex metric_read_lock;
@@ -104,6 +106,10 @@ int hsmp_create_sensor(struct device *dev, u16 sock_ind);
 static inline int hsmp_create_sensor(struct device *dev, u16 sock_ind) { return 0; }
 #endif
 int hsmp_msg_get_nargs(u16 sock_ind, u32 msg_id, u32 *data, u8 num_args);
+int hsmp_sock_class_register(void);
+void hsmp_sock_class_unregister(void);
+int hsmp_sock_dev_register(struct device *parent, struct hsmp_socket *sock);
+void hsmp_sock_dev_unregister(struct hsmp_socket *sock);
 extern const struct attribute_group *hsmp_sock_groups[];
 
 /*
drivers/platform/x86/amd/hsmp/sysfs.c +70 -1

86 lines not on this page · raw message

Signature · 1 line
2.53.0
author
#3 lore raw

PATCH v2 3/5 platform/x86/amd/hsmp: Expose socket attributes from the platform driver

In reply to Erwan Velu

From: Erwan Velu <[email protected]>

The platform driver creates bare socketN attribute groups on the amd_hsmp platform device, which only hold metrics_bin. On systems without the HSMP ACPI object, attributes such as pwr_current_active_freq_limit are therefore missing, although the driver can send the same HSMP messages as the ACPI one.

Register the amd_hsmp class socketN devices from the platform driver, as children of the amd_hsmp platform device, and drop the socketN attribute groups they replace. The socket devices carry hsmp_sock_groups, metrics_bin included, so all the per-socket attributes are now available under /sys/class/amd_hsmp/socketN/.

As class devices, they are placed by the driver core in an amd_hsmp glue directory below their parent, i.e. in /sys/devices/platform/amd_hsmp/amd_hsmp/socketN/. To keep the existing /sys/devices/platform/amd_hsmp/socketN/metrics_bin path working, add a socketN symlink from the platform device to each socket device.

As the socket devices and their symlinks are now the only way metrics_bin is exposed, failing to create one fails the probe. They are torn down by a devres action added after hsmp_pltdrv_release(), so they are gone before the socket array they reference is released.

Systems running HSMP protocol version 7 or later with the platform driver (Family 1Ah model 0x00-0x0F without the HSMP ACPI object) now see metrics_bin, as with the ACPI driver: reads return -EOPNOTSUPP and point userspace to HSMP_IOCTL_GET_TELEMETRY_DATA, as the version 7 table does not fit in a sysfs binary attribute. It used to be hidden there.

On a single socket Zen4 (Family 19h) server probed by the platform driver, this gives:

  $ ls -l /sys/devices/platform/amd_hsmp/
  drwxr-xr-x amd_hsmp
  ...
  lrwxrwxrwx socket0 -> amd_hsmp/socket0
  $ ls -l /sys/class/amd_hsmp/
  socket0 -> ../../devices/platform/amd_hsmp/amd_hsmp/socket0
  $ cat /sys/class/amd_hsmp/socket0/pwr_current_active_freq_limit
  3100

This system runs HSMP protocol version 5, so metrics_bin is not visible, as before this change.

Assisted-by claude-opus-5-5
---
 Documentation/arch/x86/amd_hsmp.rst  |   8 +-
 drivers/platform/x86/amd/hsmp/plat.c | 155 +++++++++++----------------
 2 files changed, 67 insertions(+), 96 deletions(-)
Documentation/arch/x86/amd_hsmp.rst +6 -2
index f145ea12af99..c4459a9dddc6 100644
@@ -75,14 +75,18 @@ e.g. /sys/devices/platform/AMDI0097:00/amd_hsmp/socket0/. For backward
 compatibility, the files are also available directly under
 /sys/devices/platform/AMDI0097:0X/.
 
+With the plat driver, the socket devices are children of the amd_hsmp
+platform device, i.e. /sys/devices/platform/amd_hsmp/amd_hsmp/socket%d/.
+For backward compatibility, /sys/devices/platform/amd_hsmp/socket%d is a
+symlink to it.
+
 1. Metrics table binary sysfs
 
 AMD MI300A MCM provides GET_METRICS_TABLE message to retrieve
 most of the system management information from SMU in one go.
 
 The metrics table is made available as hexadecimal sysfs binary file
-under per socket sysfs directory created at
-/sys/devices/platform/amd_hsmp/socket%d/metrics_bin
+/sys/class/amd_hsmp/socket%d/metrics_bin
 
 Note: lseek() is not supported as entire metrics table is read.
 
drivers/platform/x86/amd/hsmp/plat.c +61 -94

188 lines not on this page · raw message

Signature · 1 line
2.53.0
author
#4 lore raw

PATCH v2 4/5 platform/x86/amd/hsmp: Add pwr_current_active_freq_limit_source_raw

In reply to Erwan Velu

From: Erwan Velu <[email protected]>

pwr_current_active_freq_limit_source reports the active frequency limit sources as a list of names, one per line, which metrics exporters have to parse and map back to a value.

Add pwr_current_active_freq_limit_source_raw, reporting the same source bitmask as a single hexadecimal value. Exporters only need a plain integer conversion, and its interpretation can be centralized in the monitoring stack, e.g. with Grafana value mappings, instead of being decoded on each server.

The bit assignment is defined by the HSMP specification and is stable:
new limit sources are only appended, existing bits never change meaning. A given value therefore has a single interpretation, whatever the platform or kernel version it comes from.

Assisted-by claude-opus-5-5
---
 Documentation/arch/x86/amd_hsmp.rst   |  4 ++++
 drivers/platform/x86/amd/hsmp/sysfs.c | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
Documentation/arch/x86/amd_hsmp.rst +4 -0
index c4459a9dddc6..6156d50362cf 100644
@@ -121,6 +121,10 @@ Following sysfs files are available at /sys/class/amd_hsmp/socket%d/.
   in MHz.
 * pwr_current_active_freq_limit_source: Source of current active frequency
   limit.
+* pwr_current_active_freq_limit_source_raw: Source of current active
+  frequency limit, as a hexadecimal bitmask. Bits 0 to 7 are, in order:
+  cHTC-Active, PROCHOT, TDC limit, PPT Limit, OPN Max, Reliability Limit,
+  APML Agent, HSMP Agent.
 
 ACPI device object format
 =========================
drivers/platform/x86/amd/hsmp/sysfs.c +18 -0
index 94670c8e689b..5615b0385477 100644
@@ -282,6 +282,21 @@ static ssize_t hsmp_freq_limit_source_show(struct device *dev, struct device_att
 	return len;
 }
 
+static ssize_t hsmp_freq_limit_source_raw_show(struct device *dev,
+					       struct device_attribute *attr, char *buf)
+{
+	struct hsmp_sys_attr *hattr = to_hsmp_sys_attr(attr);
+	struct hsmp_socket *sock = dev_get_drvdata(dev);
+	u32 data;
+	int ret;
+
+	ret = hsmp_msg_get_nargs(sock->sock_ind, hattr->msg_id, &data, 1);
+	if (ret)
+		return ret;
+
+	return sysfs_emit(buf, "0x%04lx\n", FIELD_GET(FREQ_SRC_IND_MASK, data));
+}
+
 static const struct bin_attribute  hsmp_metric_tbl_attr = {
 	.attr = { .name = HSMP_METRICS_TABLE_NAME, .mode = 0444},
 	.read = hsmp_metric_tbl_acpi_read,
@@ -315,6 +330,8 @@ HSMP_DEV_ATTR(pwr_current_active_freq_limit, HSMP_GET_SOCKET_FREQ_LIMIT,
 	      hsmp_freq_limit_show, 0444);
 HSMP_DEV_ATTR(pwr_current_active_freq_limit_source, HSMP_GET_SOCKET_FREQ_LIMIT,
 	      hsmp_freq_limit_source_show, 0444);
+HSMP_DEV_ATTR(pwr_current_active_freq_limit_source_raw, HSMP_GET_SOCKET_FREQ_LIMIT,
+	      hsmp_freq_limit_source_raw_show, 0444);
 
 static struct attribute *hsmp_dev_attr_list[] = {
 	&hattr_c0_residency_input.dattr.attr,
@@ -331,6 +348,7 @@ static struct attribute *hsmp_dev_attr_list[] = {
 	&hattr_clk_fmin.dattr.attr,
 	&hattr_pwr_current_active_freq_limit.dattr.attr,
 	&hattr_pwr_current_active_freq_limit_source.dattr.attr,
+	&hattr_pwr_current_active_freq_limit_source_raw.dattr.attr,
 	NULL
 };
 
Signature · 1 line
2.53.0
author
#5 lore raw

PATCH v2 5/5 Documentation/ABI: Add sysfs-class-amd_hsmp

In reply to Erwan Velu

From: Erwan Velu <[email protected]>

The per-socket HSMP attributes are only described in Documentation/arch/x86/amd_hsmp.rst, and have no entry in Documentation/ABI/.

Document /sys/class/amd_hsmp/socketX/ and its attributes as the interface for userspace, whichever driver probed. The historical /sys/devices/platform/AMDI0097:0X/ and /sys/devices/platform/amd_hsmp/socketX/ locations keep working.

Assisted-by claude-opus-5-5
---
 .../ABI/testing/sysfs-class-amd_hsmp          | 120 ++++++++++++++++++
 MAINTAINERS                                   |   1 +
 2 files changed, 121 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-amd_hsmp
Documentation/ABI/testing/sysfs-class-amd_hsmp new file +120 -0
new file mode 100644
index 000000000000..32da798dd2ad
@@ -0,0 +1,120 @@
+What:		/sys/class/amd_hsmp/socketX/
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	One directory per CPU socket exposing the AMD Host System
+		Management Port (HSMP) per-socket attributes. X is the socket
+		index, starting at 0.
+
+		The directory is a link to a device whose parent is the device
+		of the driver that probed the socket, so the attributes below
+		are the same whichever driver is in use:
+
+		- ACPI driver:
+		  /sys/devices/platform/AMDI0097:0X/amd_hsmp/socketX/
+		- plat driver:
+		  /sys/devices/platform/amd_hsmp/amd_hsmp/socketX/
+
+		The historical /sys/devices/platform/AMDI0097:0X/ attributes
+		and /sys/devices/platform/amd_hsmp/socketX/ (now a symlink to
+		the socket device) keep working.
+
+		On client platforms, only smu_fw_version and protocol_version
+		are visible.
+
+What:		/sys/class/amd_hsmp/socketX/metrics_bin
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) Binary HSMP metrics table of the socket, as defined by
+		struct hsmp_metric_table in arch/x86/include/uapi/asm/amd_hsmp.h.
+
+		Only supported with HSMP protocol version 6. On protocol version
+		7 and later, a read returns -EOPNOTSUPP and the table must be
+		read with the HSMP_IOCTL_GET_TELEMETRY_DATA ioctl on /dev/hsmp.
+		lseek() is not supported, the whole table is read at once.
+
+What:		/sys/class/amd_hsmp/socketX/smu_fw_version
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) SMU firmware version, as "major.minor.debug".
+
+What:		/sys/class/amd_hsmp/socketX/protocol_version
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) HSMP interface version.
+
+What:		/sys/class/amd_hsmp/socketX/c0_residency_input
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) Percentage of cores in C0 state.
+
+What:		/sys/class/amd_hsmp/socketX/prochot_status
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) 1 if the processor is at its thermal threshold value
+		(PROCHOT asserted), 0 otherwise.
+
+What:		/sys/class/amd_hsmp/socketX/ddr_max_bw
+What:		/sys/class/amd_hsmp/socketX/ddr_utilised_bw_input
+What:		/sys/class/amd_hsmp/socketX/ddr_utilised_bw_perc_input
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) DDR bandwidth of the socket:
+
+		==========================	=================================
+		ddr_max_bw			Theoretical maximum, in GB/s
+		ddr_utilised_bw_input		Currently utilized, in GB/s
+		ddr_utilised_bw_perc_input	Currently utilized, in percent
+		==========================	=================================
+
+What:		/sys/class/amd_hsmp/socketX/mclk_input
+What:		/sys/class/amd_hsmp/socketX/fclk_input
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) Memory clock (mclk_input) and fabric clock (fclk_input),
+		in MHz.
+
+What:		/sys/class/amd_hsmp/socketX/clk_fmax
+What:		/sys/class/amd_hsmp/socketX/clk_fmin
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) Maximum (clk_fmax) and minimum (clk_fmin) frequency of
+		the socket, in MHz.
+
+What:		/sys/class/amd_hsmp/socketX/cclk_freq_limit_input
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) Core clock frequency limit of the socket, in MHz.
+
+What:		/sys/class/amd_hsmp/socketX/pwr_current_active_freq_limit
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) Current active frequency limit of the socket, in MHz.
+
+What:		/sys/class/amd_hsmp/socketX/pwr_current_active_freq_limit_source
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) Sources of the current active frequency limit, one name
+		per line, among: cHTC-Active, PROCHOT, TDC limit, PPT Limit,
+		OPN Max, Reliability Limit, APML Agent, HSMP Agent.
+
+What:		/sys/class/amd_hsmp/socketX/pwr_current_active_freq_limit_source_raw
+Date:		November 2026
+KernelVersion:	7.5
+Contact:	[email protected]
+Description:	(RO) Sources of the current active frequency limit, as a
+		hexadecimal bitmask (e.g. "0x0003"). Bits 0 to 7 are, in order:
+		cHTC-Active, PROCHOT, TDC limit, PPT Limit, OPN Max, Reliability
+		Limit, APML Agent, HSMP Agent. The bit assignment comes from the
+		HSMP specification: new sources are only appended.
MAINTAINERS +1 -0
index ccbcdc0799b9..1e23f4e5c902 100644
@@ -1193,6 +1193,7 @@ M:	Naveen Krishna Chatradhi <[email protected]>
 R:	Carlos Bilbao <[email protected]>
 L:	[email protected]
 S:	Maintained
+F:	Documentation/ABI/testing/sysfs-class-amd_hsmp
 F:	Documentation/arch/x86/amd_hsmp.rst
 F:	arch/x86/include/asm/amd/hsmp.h
 F:	arch/x86/include/uapi/asm/amd_hsmp.h
Signature · 1 line
2.53.0