[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <244c62e1-ee2d-4356-b00a-2c2cc3ac2ba4@intel.com>
Date: Fri, 9 Jan 2026 08:17:09 -0800
From: Reinette Chatre <reinette.chatre@...el.com>
To: Borislav Petkov <bp@...en8.de>, Tony Luck <tony.luck@...el.com>
CC: Fenghua Yu <fenghuay@...dia.com>, Maciej Wieczor-Retman
<maciej.wieczor-retman@...el.com>, Peter Newman <peternewman@...gle.com>,
James Morse <james.morse@....com>, Babu Moger <babu.moger@....com>, "Drew
Fustini" <dfustini@...libre.com>, Dave Martin <Dave.Martin@....com>, Chen Yu
<yu.c.chen@...el.com>, <x86@...nel.org>, <linux-kernel@...r.kernel.org>,
<patches@...ts.linux.dev>
Subject: Re: [PATCH v17 19/32] x86/resctrl: Find and enable usable telemetry
events
Hi Boris,
On 1/9/26 4:16 AM, Borislav Petkov wrote:
> On Wed, Dec 17, 2025 at 09:21:06AM -0800, Tony Luck wrote:
>> -static bool enable_events(struct event_group *e, struct pmt_feature_group *p)
>> +/*
>> + * Clear the address field of regions that did not pass the checks in
>> + * skip_telem_region() so they will not be used by intel_aet_read_event().
>> + * This is safe to do because intel_pmt_get_regions_by_feature() allocates
>> + * a new pmt_feature_group structure to return to each caller and only makes
>> + * use of the pmt_feature_group::kref field when intel_pmt_put_feature_group()
>> + * returns the structure.
>> + */
>> +static void mark_telem_region_unusable(struct telemetry_region *tr)
>> {
>> + tr->addr = NULL;
>> +}
>
> We probably don't really need such a silly helper which is used only once and,
> AFAICT, doesn't grow any other functionality by the end of the patchset:
>
> diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/resctrl/intel_aet.c
> index 4074fd43830e..7d0bd7b070a7 100644
> --- a/arch/x86/kernel/cpu/resctrl/intel_aet.c
> +++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c
> @@ -112,19 +112,6 @@ static struct event_group *known_event_groups[] = {
> _peg < &known_event_groups[ARRAY_SIZE(known_event_groups)]; \
> _peg++)
>
> -/*
> - * Clear the address field of regions that did not pass the checks in
> - * skip_telem_region() so they will not be used by intel_aet_read_event().
> - * This is safe to do because intel_pmt_get_regions_by_feature() allocates
> - * a new pmt_feature_group structure to return to each caller and only makes
> - * use of the pmt_feature_group::kref field when intel_pmt_put_feature_group()
> - * returns the structure.
> - */
> -static void mark_telem_region_unusable(struct telemetry_region *tr)
> -{
> - tr->addr = NULL;
> -}
> -
> static bool skip_telem_region(struct telemetry_region *tr, struct event_group *e)
> {
> if (tr->guid != e->guid)
> @@ -149,7 +136,16 @@ static bool group_has_usable_regions(struct event_group *e, struct pmt_feature_g
>
> for (int i = 0; i < p->count; i++) {
> if (skip_telem_region(&p->regions[i], e)) {
> - mark_telem_region_unusable(&p->regions[i]);
> + /*
> + * Clear the address field of regions that did not pass the checks in
> + * skip_telem_region() so they will not be used by intel_aet_read_event().
> + * This is safe to do because intel_pmt_get_regions_by_feature() allocates
> + * a new pmt_feature_group structure to return to each caller and only makes
> + * use of the pmt_feature_group::kref field when intel_pmt_put_feature_group()
> + * returns the structure.
> + */
> + p->regions[i].addr = NULL;
> +
> continue;
> }
> usable_regions = true;
>
>
Looks good to me. Thank you very much.
Reinette
Powered by blists - more mailing lists