[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aWEydesWamRxWJwM@agluck-desk3>
Date: Fri, 9 Jan 2026 08:53:09 -0800
From: "Luck, Tony" <tony.luck@...el.com>
To: Borislav Petkov <bp@...en8.de>
CC: Fenghua Yu <fenghuay@...dia.com>, Reinette Chatre
<reinette.chatre@...el.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>, Ilpo Järvinen
<ilpo.jarvinen@...ux.intel.com>
Subject: Re: [PATCH v17 19/32] x86/resctrl: Find and enable usable telemetry
events
On Fri, Jan 09, 2026 at 01:16:16PM +0100, 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:
This was made a separate function in response to a comment against the
v9 series from Ilpo:
As this is at least semi-hacky, I suggest you move it into own function
and add a bit longer comment to the function (along the lines what the
changelog also states why it works).
Link: https://lore.kernel.org/all/3b0546d4-d0bc-f76e-e1c2-eef2b4abf0f1@linux.intel.com/
But at that point the "p->regions[i].addr = NULL;" was part of a much
larger function. Since then refactoring into various helpers means that
it now looks OK to move it inline. The comment about why it is safe to
update a structure that was provided by Intel-PMT driver is the
important bit, and I see that you preserved that.
So LGTM
-Tony
Powered by blists - more mailing lists