Re: [PATCH v10 14/17] x86/resctrl: Export interface to report telemetry unbind/remove
From: Luck, Tony
Date: Tue Aug 18 2026 - 13:32:30 EST
On Tue, Aug 18, 2026 at 08:38:05AM -0700, Reinette Chatre wrote:
> 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.
PMT internals are a mystery to me too. I may have been overly pessimistic in
the complexity needed here. It does seem likely that all the entries being
removed together would be on the same physical package.
I'll check with David Box if it is safe to just get the package_id for the
first entry and assume that the others are all the same. If so, the interface
to resctrl can simply pass one package id instead of a bitmask.
>
> Reinette
-Tony