[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251127095702.GP724103@e132581.arm.com>
Date: Thu, 27 Nov 2025 09:57:02 +0000
From: Leo Yan <leo.yan@....com>
To: James Clark <james.clark@...aro.org>
Cc: Kuan-Wei Chiu <visitorckw@...il.com>,
Mike Leach <mike.leach@...aro.org>, suzuki.poulose@....com,
alexander.shishkin@...ux.intel.com, pratikp@...eaurora.org,
mathieu.poirier@...aro.org, gregkh@...uxfoundation.org,
jserv@...s.ncku.edu.tw, marscheng@...gle.com, ericchancf@...gle.com,
milesjiang@...gle.com, nickpan@...gle.com,
coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] coresight: etm3x: Fix buffer overwrite in cntr_val_show()
On Thu, Nov 27, 2025 at 09:30:28AM +0000, James Clark wrote:
[...]
> > > - for (i = 0; i < drvdata->nr_cntr; i++) {
> > > - val = etm_readl(drvdata, ETMCNTVRn(i));
> > > - ret += sprintf(buf, "counter %d: %x\n", i, val);
> > > + return sprintf(buf, "%x\n", val);
> > > }
> > > - return ret;
> > > + val = etm_readl(drvdata, ETMCNTVRn(config->cntr_idx));
> >
> > It is not right to read register at here (it cannot promise to read the
> > CPU (cp14) register on the target CPU).
> >
> > Please refer to the same function in coresight-etm4x-sysfs.c. I think
> > we can do the same thing at here.
> >
>
> That's a different fix than the display bug though. This change doesn't
> change that if it's already wrong. The display fix should go in alone and
> then if there is an issue with not running things on the right CPU that
> should go in separately.
Makes sense. So the pasted change is fine for me.
Thanks for correcting!
Powered by blists - more mailing lists