lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <DU2PR04MB88229A527F3A0FB0328B17758C5F2@DU2PR04MB8822.eurprd04.prod.outlook.com>
Date: Thu, 29 Feb 2024 06:07:04 +0000
From: Xu Yang <xu.yang_2@....com>
To: Will Deacon <will@...nel.org>
CC: Frank Li <frank.li@....com>, "mark.rutland@....com"
	<mark.rutland@....com>, "robh+dt@...nel.org" <robh+dt@...nel.org>,
	"krzysztof.kozlowski+dt@...aro.org" <krzysztof.kozlowski+dt@...aro.org>,
	"conor+dt@...nel.org" <conor+dt@...nel.org>, "shawnguo@...nel.org"
	<shawnguo@...nel.org>, "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>, "festevam@...il.com"
	<festevam@...il.com>, "john.g.garry@...cle.com" <john.g.garry@...cle.com>,
	"jolsa@...nel.org" <jolsa@...nel.org>, "namhyung@...nel.org"
	<namhyung@...nel.org>, "irogers@...gle.com" <irogers@...gle.com>,
	dl-linux-imx <linux-imx@....com>, "mike.leach@...aro.org"
	<mike.leach@...aro.org>, "leo.yan@...aro.org" <leo.yan@...aro.org>,
	"peterz@...radead.org" <peterz@...radead.org>, "mingo@...hat.com"
	<mingo@...hat.com>, "acme@...nel.org" <acme@...nel.org>,
	"alexander.shishkin@...ux.intel.com" <alexander.shishkin@...ux.intel.com>,
	"adrian.hunter@...el.com" <adrian.hunter@...el.com>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "linux-perf-users@...r.kernel.org"
	<linux-perf-users@...r.kernel.org>, "imx@...ts.linux.dev"
	<imx@...ts.linux.dev>
Subject: RE: [EXT] Re: [PATCH v4 2/6] perf: imx_perf: refactor driver for
 imx93

Hi Will,

> 
> 
> On Wed, Jan 31, 2024 at 01:58:07PM +0800, Xu Yang wrote:
> > This driver is initinally used to support imx93 Soc and now it's time to
> > add support for imx95 Soc. However, some macro definitions and events are
> > different on these two Socs. For preparing imx95 supports, this will
> > refactor driver for imx93.
> >
> > Signed-off-by: Xu Yang <xu.yang_2@....com>
> >
> > ---
> > Changes in v4:
> >  - new patch
> > ---
> >  drivers/perf/fsl_imx9_ddr_perf.c | 121 ++++++++++++++++++++++---------
> >  1 file changed, 87 insertions(+), 34 deletions(-)
> 
> [...]
> 
> > @@ -476,12 +490,12 @@ static int ddr_perf_event_add(struct perf_event *event, int flags)
> >       hwc->idx = counter;
> >       hwc->state |= PERF_HES_STOPPED;
> >
> > +     /* read trans, write trans, read beat */
> > +     imx93_ddr_perf_monitor_config(pmu, cfg, cfg1, cfg2);
> > +
> >       if (flags & PERF_EF_START)
> >               ddr_perf_event_start(event, flags);
> >
> > -     /* read trans, write trans, read beat */
> > -     ddr_perf_monitor_config(pmu, cfg, cfg1, cfg2);
> > -
> >       return 0;
> 
> This change looks like more than just refactoring and should probably be a
> separate patch. Is it a bug fix for the existing code?

Yes, I found the order has an impact. I will create a patch for it.

> 
> > +static int ddr_perf_add_events(struct ddr_pmu *pmu)
> > +{
> > +     int i, ret;
> > +     struct attribute **attrs = pmu->devtype_data->attrs;
> > +     struct device *pmu_dev = pmu->pmu.dev;
> > +
> > +     if (!attrs)
> > +             return 0;
> > +
> > +     for (i = 0; attrs[i]; i++) {
> > +             ret = sysfs_add_file_to_group(&pmu_dev->kobj, attrs[i], "events");
> > +             if (ret) {
> > +                     dev_warn(pmu->dev, "i.MX9 DDR Perf add events failed (%d)\n", ret);
> > +                     return ret;
> 
> Can you use the '.is_visible' callback in 'struct attribute_group' to avoid
> having to manipulate sysfs directly like this? For example, create separate
> groups for the imx93 and imx95-specific events and only make them visible
> if we're on the appropriate hardware.

Yes, I will try your suggestion.

Thanks,
Xu Yang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ