[PATCH V3 00/15] Intel VSEC/PMT: Introduce Discovery Driver

David E. Box posted 15 patches 3 months ago
.../testing/sysfs-class-intel_pmt-features    | 134 ++++
MAINTAINERS                                   |   2 +
drivers/platform/x86/intel/plr_tpmi.c         |   3 +-
drivers/platform/x86/intel/pmt/Kconfig        |  27 +
drivers/platform/x86/intel/pmt/Makefile       |   4 +
drivers/platform/x86/intel/pmt/class.c        |  35 +-
drivers/platform/x86/intel/pmt/class.h        |   9 +
.../platform/x86/intel/pmt/discovery-kunit.c  | 116 ++++
drivers/platform/x86/intel/pmt/discovery.c    | 635 ++++++++++++++++++
drivers/platform/x86/intel/pmt/features.c     | 205 ++++++
drivers/platform/x86/intel/pmt/telemetry.c    |  94 ++-
.../intel/speed_select_if/isst_tpmi_core.c    |   9 +-
.../uncore-frequency/uncore-frequency-tpmi.c  |   7 +-
drivers/platform/x86/intel/vsec.c             | 372 +++++++++-
drivers/platform/x86/intel/vsec_tpmi.c        |   8 +-
drivers/powercap/intel_rapl_tpmi.c            |   9 +-
include/linux/intel_pmt_features.h            | 157 +++++
include/linux/intel_tpmi.h                    |  27 +-
include/linux/intel_vsec.h                    |  98 ++-
19 files changed, 1885 insertions(+), 66 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-class-intel_pmt-features
create mode 100644 drivers/platform/x86/intel/pmt/discovery-kunit.c
create mode 100644 drivers/platform/x86/intel/pmt/discovery.c
create mode 100644 drivers/platform/x86/intel/pmt/features.c
create mode 100644 include/linux/intel_pmt_features.h
[PATCH V3 00/15] Intel VSEC/PMT: Introduce Discovery Driver
Posted by David E. Box 3 months ago
This patch series introduces a new discovery driver for Intel Platform
Monitoring Technology (PMT) and a set of supporting changes to improve
telemetry integration across Intel VSEC features.

The primary goal of this series is to add the PMT Discovery driver, which
enumerates and exposes telemetry attributes by parsing hardware-provided
discovery tables from OOBMSM devices. In particular, the discovery driver
gathers detailed capability information (such as telemetry region
attributes) that will later enable direct access to telemetry regions via a
new API (intel_pmt_get_regions_by_feature()). This API is crucial for
retrieving data like per-RMID counters.

The remainder of the series consists of several preparatory and testing
patches:

1. Private Data and CPU Mapping:  The VSEC driver now includes
per-device private data to store the OOBMSM-to-CPU mapping. The TPMI driver
copies its platform info into this common area (via
intel_vsec_set_mapping()), allowing other VSEC features to access CPU
mapping information without redundant queries.

2. Device Links Enhancements:  With telemetry now depending on both the
TPMI driver (for CPU mapping) and the new discovery driver (for telemetry
region attributes), device links have been added and optimized. These
changes ensure that supplier drivers are probed and registered before
consumer drivers, enforcing the proper dependency order for reliable
telemetry feature access.

4. Discovery Driver and API:  The core of the series is the addition of
the PMT Discovery driver. This driver not only implements discovery of
telemetry attributes and capability data (exposed via sysfs) but also
introduces an API to retrieve telemetry regions by feature, which is
essential for features like per-RMID telemetry counters.

5. Testing:  A simple KUNIT test is provided for the enhanced discovery
API to ensure its reliability and correctness.

Together, these patches provide a foundation for future telemetry
enhancements in the Intel VSEC framework. They enable a unified interface
for accessing hardware telemetry capabilities and ensure that inter-driver
dependencies are properly managed through device links.

David E. Box (15):
  MAINTAINERS: Add link to documentation of Intel PMT ABI
  platform/x86/intel/vsec: Add private data for per-device data
  platform/x86/intel/vsec: Create wrapper to walk PCI config space
  platform/x86/intel/vsec: Add device links to enforce dependencies
  platform/x86/intel/vsec: Skip absent features during initialization
  platform/x86/intel/vsec: Skip driverless features
  platform/x86/intel/vsec: Add new Discovery feature
  platform/x86/intel/pmt: Add PMT Discovery driver
  docs: Add ABI documentation for intel_pmt feature directories
  platform/x86/intel/tpmi: Relocate platform info to intel_vsec.h
  platform/x86/intel/vsec: Set OOBMSM to CPU mapping
  platform/x86/intel/tpmi: Get OOBMSM CPU mapping from TPMI
  platform/x86/intel/pmt/discovery: Get telemetry attributes
  platform/x86/intel/pmt/telemetry: Add API to retrieve telemetry
    regions by feature
  platform/x86/intel/pmt: KUNIT test for PMT Enhanced Discovery API

 .../testing/sysfs-class-intel_pmt-features    | 134 ++++
 MAINTAINERS                                   |   2 +
 drivers/platform/x86/intel/plr_tpmi.c         |   3 +-
 drivers/platform/x86/intel/pmt/Kconfig        |  27 +
 drivers/platform/x86/intel/pmt/Makefile       |   4 +
 drivers/platform/x86/intel/pmt/class.c        |  35 +-
 drivers/platform/x86/intel/pmt/class.h        |   9 +
 .../platform/x86/intel/pmt/discovery-kunit.c  | 116 ++++
 drivers/platform/x86/intel/pmt/discovery.c    | 635 ++++++++++++++++++
 drivers/platform/x86/intel/pmt/features.c     | 205 ++++++
 drivers/platform/x86/intel/pmt/telemetry.c    |  94 ++-
 .../intel/speed_select_if/isst_tpmi_core.c    |   9 +-
 .../uncore-frequency/uncore-frequency-tpmi.c  |   7 +-
 drivers/platform/x86/intel/vsec.c             | 372 +++++++++-
 drivers/platform/x86/intel/vsec_tpmi.c        |   8 +-
 drivers/powercap/intel_rapl_tpmi.c            |   9 +-
 include/linux/intel_pmt_features.h            | 157 +++++
 include/linux/intel_tpmi.h                    |  27 +-
 include/linux/intel_vsec.h                    |  98 ++-
 19 files changed, 1885 insertions(+), 66 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-intel_pmt-features
 create mode 100644 drivers/platform/x86/intel/pmt/discovery-kunit.c
 create mode 100644 drivers/platform/x86/intel/pmt/discovery.c
 create mode 100644 drivers/platform/x86/intel/pmt/features.c
 create mode 100644 include/linux/intel_pmt_features.h


base-commit: d0b3b7b22dfa1f4b515fd3a295b3fd958f9e81af
-- 
2.43.0
Re: [PATCH V3 00/15] Intel VSEC/PMT: Introduce Discovery Driver
Posted by Ilpo Järvinen 3 months ago
On Wed, 02 Jul 2025 19:28:15 -0700, David E. Box wrote:

> This patch series introduces a new discovery driver for Intel Platform
> Monitoring Technology (PMT) and a set of supporting changes to improve
> telemetry integration across Intel VSEC features.
> 
> The primary goal of this series is to add the PMT Discovery driver, which
> enumerates and exposes telemetry attributes by parsing hardware-provided
> discovery tables from OOBMSM devices. In particular, the discovery driver
> gathers detailed capability information (such as telemetry region
> attributes) that will later enable direct access to telemetry regions via a
> new API (intel_pmt_get_regions_by_feature()). This API is crucial for
> retrieving data like per-RMID counters.
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[01/15] MAINTAINERS: Add link to documentation of Intel PMT ABI
        commit: fb1311b3f171bbb3c07cc7764ec981605564c83a
[02/15] platform/x86/intel/vsec: Add private data for per-device data
        commit: dc957ab6aa05c118c3da0542428a4d6602aa2d2d
[03/15] platform/x86/intel/vsec: Create wrapper to walk PCI config space
        commit: b0631f8a5740c55b52d02174cc4c9c84cc7a16a1
[04/15] platform/x86/intel/vsec: Add device links to enforce dependencies
        commit: 8a67d4b49bbdebcd255abde9e652092c3de3b657
[05/15] platform/x86/intel/vsec: Skip absent features during initialization
        commit: 1f3855ea7d6b03f68c2eec7a0bcd537cedcc6680
[06/15] platform/x86/intel/vsec: Skip driverless features
        commit: e4436e98672c7993cdfd7743efd0fcaa8df7cc17
[07/15] platform/x86/intel/vsec: Add new Discovery feature
        commit: 10f32796e86c04f73b7f8580cc9483765ed19f49
[08/15] platform/x86/intel/pmt: Add PMT Discovery driver
        commit: d9a0788093565c300f7c8dd034dbfa6ac4da9aa6
[09/15] docs: Add ABI documentation for intel_pmt feature directories
        commit: 2e7ba52110ef15d29846b40eb28b400f1fb1834a
[10/15] platform/x86/intel/tpmi: Relocate platform info to intel_vsec.h
        commit: 934954df0f44de5e10afc1af84c06f78149f15fe
[11/15] platform/x86/intel/vsec: Set OOBMSM to CPU mapping
        commit: a885a2780937afac4f31f00d11663f50d05dfb35
[12/15] platform/x86/intel/tpmi: Get OOBMSM CPU mapping from TPMI
        commit: c9699057521834862616ce159a47bd33920f0d9f
[13/15] platform/x86/intel/pmt/discovery: Get telemetry attributes
        commit: 86fc85c75bcd9b0f28afadd60c9f890669b42ba4
[14/15] platform/x86/intel/pmt/telemetry: Add API to retrieve telemetry regions by feature
        commit: 42dabe5442887946b16e64c6ebe91d2671a96fbb
[15/15] platform/x86/intel/pmt: KUNIT test for PMT Enhanced Discovery API
        commit: b9707d46a95962bb4e28ae1929015e419ad6aff7

--
 i.