X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH v4 0/7] platform/x86/amd/pmf: Introduce PMF util layer with userspace interface
@ 2026-05-07 14:45 Shyam Sundar S K
  2026-05-07 14:45 ` [PATCH v4 1/7] platform/x86/amd/pmf: Add util layer and userspace character device interface Shyam Sundar S K
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Shyam Sundar S K @ 2026-05-07 14:45 UTC (permalink / raw)
  To: hansg, ilpo.jarvinen
  Cc: platform-driver-x86, mario.limonciello, Sanket.Goswami,
	Shyam Sundar S K

This patch series introduces a new util layer for the AMD Platform
Management Framework (PMF) driver that exposes a minimal userspace
interface for metrics monitoring and feature discovery.

AMD PMF currently manages power and thermal policies internally through
Smart PC features, Auto Mode, Policy Builder, Static/Dynamic Power
Sliders. However, system designers and OEMs need visibility into PMF
metrics and feature status for validation, debugging, and integration
with monitoring tools.

This series addresses that need by adding a character device interface
that allows controlled access to PMF metrics data while maintaining
the driver's existing automated policy management.

The primary use case is integration with userspace tools like AMD
SystemDeck, which are widely used by system designers to:
- Monitor real-time power and thermal behavior
- Validate PMF feature operation during platform bring-up
- Debug thermal issues by tracking skin temperature, C-state residency,
  and socket power metrics
- Verify BIOS input/output policy values during Smart PC operation

The util layer reads from the existing Trusted Application (TA) shared
memory buffer and cached BIOS output values, adding no new communication
overhead with the TA.

v4:
 - Implement single amd_pmf_info structure which can cover all members.
 - Add amd_pmf prefix for enums/functions within the UAPI header.
 - Keep test-pmf tool outside of selftests directory.
 - Include necessary header files.
 - Address review comments received from Ilpo on v3.

v3:
 - Stop exporting battery information via util layer.
 - Optimize the core logic for fetching BIOS outputs.
 - Update the documentation patch to reflect the current util layer design.
 - Consolidate amd-pmf-io.h changes into common UAPI header.
 - Define a single unified uAPI structure and IOCTL.
 - Address other v2 review remarks [1]

v2:
 - address remarks from v1
 - add a new tool that exercises the IOCTLs from PMF interface

[1] https://lore.kernel.org/platform-driver-x86/20251111071010.4179492-1-Shyam-sundar.S-k@amd.com/

Shyam Sundar S K (7):
  platform/x86/amd/pmf: Add util layer and userspace character device
    interface
  platform/x86/amd/pmf: store BIOS output values for user-space metrics
    via util IOCTL
  platform/x86/amd/pmf: Add feature discovery support to util interface
  platform/x86/amd/pmf: Store commonly used enums in the header file
  platform/x86/amd/pmf: Move debug helper functions to UAPI header
  platform/x86/amd/pmf: Introduce AMD PMF testing tool for driver
    metrics and features
  Documentation/ABI: add testing entry for AMD PMF character device
    interface

 Documentation/ABI/testing/amdpmf-interface    |  75 +++++++
 MAINTAINERS                                   |   1 +
 .../amd-sfh-hid/sfh1_1/amd_sfh_interface.c    |  13 +-
 drivers/platform/x86/amd/pmf/Kconfig          |  10 +
 drivers/platform/x86/amd/pmf/Makefile         |   2 +
 drivers/platform/x86/amd/pmf/core.c           |   5 +
 drivers/platform/x86/amd/pmf/pmf.h            |  33 +--
 drivers/platform/x86/amd/pmf/spc.c            |  62 +-----
 drivers/platform/x86/amd/pmf/tee-if.c         |  11 +-
 drivers/platform/x86/amd/pmf/util.c           | 155 +++++++++++++
 include/linux/amd-pmf-io.h                    |   9 -
 include/uapi/linux/amd-pmf.h                  | 205 ++++++++++++++++++
 tools/platform/x86/amd/Makefile               |  60 +++++
 tools/platform/x86/amd/test-pmf.c             | 142 ++++++++++++
 14 files changed, 687 insertions(+), 96 deletions(-)
 create mode 100644 Documentation/ABI/testing/amdpmf-interface
 create mode 100644 drivers/platform/x86/amd/pmf/util.c
 create mode 100644 include/uapi/linux/amd-pmf.h
 create mode 100644 tools/platform/x86/amd/Makefile
 create mode 100644 tools/platform/x86/amd/test-pmf.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-05-20 18:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 14:45 [PATCH v4 0/7] platform/x86/amd/pmf: Introduce PMF util layer with userspace interface Shyam Sundar S K
2026-05-07 14:45 ` [PATCH v4 1/7] platform/x86/amd/pmf: Add util layer and userspace character device interface Shyam Sundar S K
2026-05-19 10:27   ` Ilpo Järvinen
2026-05-07 14:45 ` [PATCH v4 2/7] platform/x86/amd/pmf: store BIOS output values for user-space metrics via util IOCTL Shyam Sundar S K
2026-05-07 14:45 ` [PATCH v4 3/7] platform/x86/amd/pmf: Add feature discovery support to util interface Shyam Sundar S K
2026-05-19 10:31   ` Ilpo Järvinen
2026-05-07 14:45 ` [PATCH v4 4/7] platform/x86/amd/pmf: Store commonly used enums in the header file Shyam Sundar S K
2026-05-19 10:33   ` Ilpo Järvinen
2026-05-07 14:45 ` [PATCH v4 5/7] platform/x86/amd/pmf: Move debug helper functions to UAPI header Shyam Sundar S K
2026-05-07 14:45 ` [PATCH v4 6/7] platform/x86/amd/pmf: Introduce AMD PMF testing tool for driver metrics and features Shyam Sundar S K
2026-05-19 10:40   ` Ilpo Järvinen
2026-05-20 18:54     ` Shyam Sundar S K
2026-05-07 14:45 ` [PATCH v4 7/7] Documentation/ABI: add testing entry for AMD PMF character device interface Shyam Sundar S K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox