Re: [PATCH v15 16/32] x86/resctrl: Discover hardware telemetry events

From: Reinette Chatre
Date: Tue Dec 09 2025 - 14:41:33 EST


Hi Tony,

On 12/4/25 12:53 PM, Tony Luck wrote:
> Each CPU collects data for telemetry events that it sends to the nearest
> telemetry event aggregator either when the value of MSR_IA32_PQR_ASSOC.RMID
> changes, or when a two millisecond timer expires.
>
> There is a feature type ("energy" or "perf"), guid, and MMIO region associated
> with each aggregator. This combination links to an XML description of the
> set of telemetry events tracked by the aggregator. XML files are published
> by Intel in a GitHub repository [1].
>
> The telemetry event aggregators maintain per-RMID per-event counts of the
> total seen for all the CPUs. There may be multiple telemetry event aggregators
> per package.
>
> There are separate sets of aggregators for each feature type. Aggregators
> in a set may have different guids. All aggregators with the same feature
> type and guid are symmetric keeping counts for the same set of events for
> the CPUs that provide data to them.
>
> The XML file for each aggregator provides the following information:
> 0) Feature type of the events ("perf" or "energy")
> 1) Which telemetry events are tracked by the aggregator.
> 2) The order in which the event counters appear for each RMID.
> 3) The value type of each event counter (integer or fixed-point).
> 4) The number of RMIDs supported.
> 5) Which additional aggregator status registers are included.
> 6) The total size of the MMIO region for an aggregator.
>
> Introduce struct event_group that condenses the relevant information from
> an XML file. Hereafter an "event group" refers to a group of events of a
> particular feature type ("energy" or "perf") with a particular guid.
>
> The event_group::pfname field is used to choose the parameter to pass

Needs imperative and "field" is redundant.

Previous paragraph can introduce event_group::pfname, for example:
Hereafter an "event group" refers to a group of events of a
particular feature type (event_group::pfname set to "energy" or
"perf") with a particular guid.

Then "Use event_group::pfname to determine the feature id needed to obtain
the aggregator details. It will later ..."

> to intel_pmt_get_regions_by_feature(). It will later be used in console
> messages and with the rdt= boot parameter.
>
> The INTEL_PMT_TELEMETRY driver enumerates support for telemetry events.
> This driver provides intel_pmt_get_regions_by_feature() to list all available
> telemetry event aggregators of a given feature type. The list includes the
> "guid", the base address in MMIO space for the region where the event counters
> are exposed, and the package id where the all the CPUs that report to this
> aggregator are located.
>
> Call INTEL_PMT_TELEMETRY's intel_pmt_get_regions_by_feature() for each event
> group to obtain a private copy of that event group's aggregator data. Duplicate
> the aggregator data between event groups that have the same feature type
> but different guid. Further processing on this private copy will be unique
> to the event group.
>
> Return the aggregator data to INTEL_PMT_TELEMETRY at resctrl exit time.
>
> resctrl will silently ignore unknown guid values.
>
> Add a new Kconfig option CONFIG_X86_CPU_RESCTRL_INTEL_AET for the Intel specific
> parts of telemetry code. This depends on the INTEL_PMT_TELEMETRY and INTEL_TPMI
> drivers being built-in to the kernel for enumeration of telemetry features.
>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> Link: https://github.com/intel/Intel-PMT # [1]
> ---


...

> +/**
> + * struct event_group - Events with the same feature type ("energy" or "perf") and guid.
> + * @pfname: PMT feature name (energy or perf) of this event group
> + * used by boot rdt= option.

nit: use quotes for energy and perf as in previous line to be consistent and help to highlight
that these are string values.

nit: move "used by boot rdt= option" to patch that introduces that usage.

> + * @pfg: Points to the aggregated telemetry space information
> + * returned by the intel_pmt_get_regions_by_feature()
> + * call to the INTEL_PMT_TELEMETRY driver that contains
> + * data for all telemetry regions of type @pfname.
> + * Valid if the system supports the event group,
> + * NULL otherwise.
> + */
> +struct event_group {
> + /* Data fields for additional structures to manage this group. */
> + const char *pfname;
> + struct pmt_feature_group *pfg;
> +};
> +

| Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette