From: Erwan Velu <erwanaliasr1@gmail.com>
To: "Naveen Krishna Chatradhi" <naveenkrishna.chatradhi@amd.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Hans de Goede" <hansg@kernel.org>
Cc: Carlos Bilbao <carlos.bilbao@kernel.org>,
Muralidhara M K <muralidhara.mk@amd.com>,
Suma Hegde <suma.hegde@amd.com>,
Muthusamy Ramalingam <muthusamy.ramalingam@amd.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, Erwan Velu <e.velu@criteo.com>
Subject: [PATCH v2 5/5] Documentation/ABI: Add sysfs-class-amd_hsmp
Date: Mon, 16 Nov 2026 16:51:47 +0100 [thread overview]
Message-ID: <20261116155147.769630-6-erwanaliasr1@gmail.com> (raw)
In-Reply-To: <20261116155147.769630-1-erwanaliasr1@gmail.com>
From: Erwan Velu <e.velu@criteo.com>
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
Signed-off-by: Erwan Velu <e.velu@criteo.com>
---
.../ABI/testing/sysfs-class-amd_hsmp | 120 ++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 121 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-class-amd_hsmp
diff --git a/Documentation/ABI/testing/sysfs-class-amd_hsmp b/Documentation/ABI/testing/sysfs-class-amd_hsmp
new file mode 100644
index 000000000000..32da798dd2ad
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-amd_hsmp
@@ -0,0 +1,120 @@
+What: /sys/class/amd_hsmp/socketX/
+Date: November 2026
+KernelVersion: 7.5
+Contact: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+Description: (RO) SMU firmware version, as "major.minor.debug".
+
+What: /sys/class/amd_hsmp/socketX/protocol_version
+Date: November 2026
+KernelVersion: 7.5
+Contact: platform-driver-x86@vger.kernel.org
+Description: (RO) HSMP interface version.
+
+What: /sys/class/amd_hsmp/socketX/c0_residency_input
+Date: November 2026
+KernelVersion: 7.5
+Contact: platform-driver-x86@vger.kernel.org
+Description: (RO) Percentage of cores in C0 state.
+
+What: /sys/class/amd_hsmp/socketX/prochot_status
+Date: November 2026
+KernelVersion: 7.5
+Contact: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+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: platform-driver-x86@vger.kernel.org
+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.
diff --git a/MAINTAINERS b/MAINTAINERS
index ccbcdc0799b9..1e23f4e5c902 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1193,6 +1193,7 @@ M: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
R: Carlos Bilbao <carlos.bilbao@kernel.org>
L: platform-driver-x86@vger.kernel.org
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
--
2.53.0
prev parent reply other threads:[~2026-11-16 15:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 15:51 [PATCH v2 0/5] platform/x86/amd/hsmp: Unify per-socket sysfs metrics Erwan Velu
2026-11-16 15:51 ` [PATCH v2 1/5] platform/x86/amd/hsmp: Move per-socket sysfs attributes to common code Erwan Velu
2026-11-16 15:51 ` [PATCH v2 2/5] platform/x86/amd/hsmp: Add amd_hsmp class with per-socket devices Erwan Velu
2026-11-16 15:51 ` [PATCH v2 3/5] platform/x86/amd/hsmp: Expose socket attributes from the platform driver Erwan Velu
2026-11-16 15:51 ` [PATCH v2 4/5] platform/x86/amd/hsmp: Add pwr_current_active_freq_limit_source_raw Erwan Velu
2026-11-16 15:51 ` Erwan Velu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116155147.769630-6-erwanaliasr1@gmail.com \
--to=erwanaliasr1@gmail.com \
--cc=carlos.bilbao@kernel.org \
--cc=e.velu@criteo.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=muralidhara.mk@amd.com \
--cc=muthusamy.ramalingam@amd.com \
--cc=naveenkrishna.chatradhi@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=suma.hegde@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®