[PATCH v14 10/24] x86/resctrl: Honor rdt={perf|energy} options to force enable AET events
From: Tony Luck
Date: Mon Oct 19 2026 - 16:52:49 EST
resctrl can disable a feature the platform supports, for example because
of an erratum or, for Application Energy Telemetry (AET), because an event
group has insufficient RMIDs. The "rdt=" kernel command line option lets
the user force such a feature on anyway, and also lets the user disable
supported features they do not need.
resctrl enumerates AET once, on first mount. Enumeration skips an event
group that is marked disabled. An event group with insufficient RMIDs is
marked disabled even when the user forced it on, but this happens after
the test for forced off when enumeration begins for an event group.
This will be broken when AET is enumerated on every mount. The disable mark
recorded for insufficient RMIDs on one mount causes the event group to be
skipped on the next, ignoring the user's explicit rdt= request to enable it.
In preparation for enumerating AET on every mount, skip a disabled event
group only if the user has not forced it on. As a result, when the command
line both disables and enables the same event group, for example
"rdt=!perf,perf:<guid>", enabling now takes precedence. This matches how
rdt= handles the other resctrl features.
Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
---
v14:
New commit message. Dropped previous supplied Reinette RB tag.
---
arch/x86/kernel/cpu/resctrl/intel_aet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/resctrl/intel_aet.c
index 66cd8c2c7a51..9f0829a82cb0 100644
--- a/arch/x86/kernel/cpu/resctrl/intel_aet.c
+++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c
@@ -262,7 +262,7 @@ static bool enable_events(struct event_group *e, struct pmt_feature_group *p)
struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_PERF_PKG].r_resctrl;
int skipped_events = 0;
- if (e->force_off)
+ if (e->force_off && !e->force_on)
return false;
if (!group_has_usable_regions(e, p))
--
2.56.0