[PATCH v8 05/16] platform/x86/intel/pmt: Prevent unbind of PMT telemetry driver
From: Tony Luck
Date: Mon Jun 15 2026 - 14:28:55 EST
The resctrl AET code uses intel_pmt_get_regions_by_feature() (exported
by the pmt_telemetry module) to obtain pmt_feature_group instances that
are populated using data from the pmt_discovery module. The returned
telemetry_region::addr values are MMIO mappings created in the
telemetry driver's probe path, and resctrl reads from them while a
mount is active.
However, a user can unbind the auxiliary driver from its device
via the sysfs "unbind" attribute. Unbinding the telemetry driver would
tear down the MMIO mappings, leaving resctrl with stale pointers and
causing a fault on the next access.
It is safe for the discovery driver to be unbound. It does all its work
at initial probe time and saves a copy of the features and RMID count.
Set device_driver::suppress_bind_attrs in the telemetry driver so
that the "bind" and "unbind" sysfs attributes are not exposed and the
user cannot detach the driver from its devices while resctrl (or
any other in-kernel consumer) may be using the resources.
Fixes: 1fb2daa60de6 ("x86/resctrl: Discover hardware telemetry events")
Assisted-by: Claude:Opus-4.7
Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
--
v8:
New patch
---
drivers/platform/x86/intel/pmt/telemetry.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c
index bdc7c24a3678..daa6da9bad2a 100644
--- a/drivers/platform/x86/intel/pmt/telemetry.c
+++ b/drivers/platform/x86/intel/pmt/telemetry.c
@@ -421,6 +421,9 @@ static struct auxiliary_driver pmt_telem_aux_driver = {
.id_table = pmt_telem_id_table,
.remove = pmt_telem_remove,
.probe = pmt_telem_probe,
+ .driver = {
+ .suppress_bind_attrs = true,
+ },
};
static int __init pmt_telem_init(void)
--
2.54.0