[PATCH v7 00/14] Allow AET to use PMT as loadable module
From: Tony Luck
Date: Mon Jun 01 2026 - 15:59:26 EST
Requiring INTEL_PMT_TELEMETRY=y to enable AET is a functional workaround
to enable enumeration of Application Energy Telemetry (AET) events, but
unacceptable to many users. It results in increased configration complexity,
increased kernel memory footprint and inability to patch problems by unloading
a module and loading an updated version.
Add a registration function to the AET code that can be used by
INTEL_PMT_TELEMETRY to provide the enumeration functions.
INTEL_PMT_TELEMETRY can be loaded/unloaded independently of
resctrl file system mount/unmount. Perform enumeration on
every mount and cleanup on every unmount.
Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
---
Changes since v6:
Link: https://lore.kernel.org/all/20260429184858.36423-1-tony.luck@xxxxxxxxx/
Sashiko found some unrelated issues during review of v6 which have
been resolved here:
Link: https://lore.kernel.org/all/cover.1779476724.git.reinette.chatre@xxxxxxxxx/
The first four patches from that series are included as patches 1-4 here
because I need the re-worked file system mount/unmount code as a base.
Patches 5-14 are the real meat of this series. Changes since v6:
1) Now pass a pointer to THIS_MODULE from pmt_telemetry via the
registration call so that AET can add/remove references instead
of this being done inside the pmt_module.
2) Limit exposure of the registration functions using EXPORT_SYMBOL_NS_GPL()
3) Fix a bug that could leak holds on the pmt_module
4) Drop the call to request_module("pmt_telemetry"). Platforms that
support AET will auto-load this based on the PCIe ID of the OOBMSM
device. Forcing a load on other platforms is a waste of time.
5) Move the unregistration to the start of pmt_telem_exit()
6) Add resctrl_arch_unmount() stub to MPAM code.
7) Use resctrl_arch_rmid_idx_encode() in limbo_release_entry() when
deciding whether to add an RMID to the free list.
8) Kconfig: drop dependency on INTEL_PMT_TELEMETRY. If a kernel is being
built for a system that supports Intel telemetry, then the user will
select it themself. Including the dependency may hide the option to
select X86_CPU_RESCTRL.
Reinette Chatre (1):
fs/resctrl: Fix deadlock for errors during mount
Tony Luck (13):
fs/resctrl: Move functions to avoid forward references in subsequent
fixes
fs/resctrl: Free mon_data structures on rdt_get_tree() failure
fs/resctrl: Fix use-after-free during unmount
x86/resctrl: Stop setting event_group::force_off on RMID shortage
fs/resctrl: Add interface to disable a monitor event
x86/resctrl: Maintain a count of enabled monitor features
fs,x86,mpam/resctrl: Handle change in number of RMIDs on each mount
x86/resctrl: Add PMT registration API for AET enumeration callbacks
platform/x86/intel/pmt: Register enumeration functions with resctrl
mpam,x86/resctrl: Resolve INTEL_PMT_TELEMETRY symbols at runtime
fs/resctrl: Call architecture hooks for every mount/unmount
x86/resctrl: Simplify Kconfig options for resctrl
Documentation/filesystems/resctrl: Add footnote for telemetry fstab
mount caveat
Documentation/filesystems/resctrl.rst | 7 +-
include/linux/resctrl.h | 43 +-
arch/x86/include/asm/resctrl.h | 19 +-
arch/x86/kernel/cpu/resctrl/internal.h | 19 +-
arch/x86/kernel/cpu/resctrl/core.c | 77 +++-
arch/x86/kernel/cpu/resctrl/intel_aet.c | 88 +++-
arch/x86/kernel/cpu/resctrl/monitor.c | 11 +-
drivers/platform/x86/intel/pmt/telemetry.c | 13 +-
drivers/resctrl/mpam_resctrl.c | 9 +
fs/resctrl/monitor.c | 59 ++-
fs/resctrl/rdtgroup.c | 458 ++++++++++++---------
arch/x86/Kconfig | 15 +-
arch/x86/kernel/cpu/resctrl/Makefile | 2 +-
13 files changed, 531 insertions(+), 289 deletions(-)
base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
--
2.54.0