Re: [PATCH v10 14/17] x86/resctrl: Export interface to report telemetry unbind/remove
From: Reinette Chatre
Date: Tue Aug 18 2026 - 11:38:53 EST
Hi Tony,
On 7/29/26 10:27 AM, Tony Luck wrote:
> Linux allows devices to be unbound from drivers, even if the modules
> cannot be unloaded because of reference counts.
>
> For telemetry this results in teardown of the virtual address mappings
> of the MMIO regions which hold the event counters. Subsequent access
> to these counters will page fault.
>
> Export intel_aet_invalidate() for the pmt_telemetry module to inform
> resctrl when invalidation is about to happen.
>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
...
> @@ -373,6 +385,18 @@ void intel_aet_unregister_enumeration(void)
> }
> EXPORT_SYMBOL_NS_GPL(intel_aet_unregister_enumeration, "INTEL_PMT");
>
> +/*
> + * pmt_telemetry driver calls this for unbind/remove operations that
> + * will invalidate the virtual addresses of MMIO registers provided
> + * by intel_pmt_get_regions_by_feature().
> + */
> +void intel_aet_invalidate(u64 pkgmask)
> +{
> + guard(mutex)(&aet_register_lock);
> + invalid_pkg_mask |= pkgmask;
> +}
> +EXPORT_SYMBOL_NS_GPL(intel_aet_invalidate, "INTEL_PMT");
> +
> bool intel_aet_pre_mount(void)
> {
> guard(mutex)(&aet_register_lock);
I noted your request for discussion in response to sashiko feedback on how this
disabling is done.
The internals of PMT are not familiar to me. The goal per changelog is to
handle the scenario when a device is unbound from the driver. Could you please
help me understand what a "device" refers to in this context? The new API appears
to accommodate packages/domains coming and going and I am trying to match that
with the pmt_event_group/event_group. If I understand this correctly this API
a "device" going offline means the same package(s) of all pmt_event_group/event_group
go offline concurrently? I think I am missing a lot here.
Reinette