linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Yangyu Chen <cyy@cyyself.name>, Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
	Mark Rutland <mark.rutland@arm.com>, Janne Grunau <j@jannau.net>,
	Hector Martin <marcan@marcan.st>, Asahi Lina <lina@asahilina.net>,
	asahi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] drivers/perf: apple_m1: fix affinity table for event 0x96 and 0x9b
Date: Mon, 01 Jul 2024 15:19:59 +0100	[thread overview]
Message-ID: <87cynxp52o.wl-maz@kernel.org> (raw)
In-Reply-To: <20240701140148.GE2250@willie-the-truck>

On Mon, 01 Jul 2024 15:01:48 +0100,
Will Deacon <will@kernel.org> wrote:
> 
> On Thu, Jun 20, 2024 at 11:04:28AM +0800, Yangyu Chen wrote:
> > Events 0x96 and 0x9b can be installed on counter 7 only. Fix this to avoid
> > getting the wrong counter value.
> > 
> > Signed-off-by: Yangyu Chen <cyy@cyyself.name>
> > ---
> >  drivers/perf/apple_m1_cpu_pmu.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/perf/apple_m1_cpu_pmu.c b/drivers/perf/apple_m1_cpu_pmu.c
> > index f322e5ca1114..b8127e5428e1 100644
> > --- a/drivers/perf/apple_m1_cpu_pmu.c
> > +++ b/drivers/perf/apple_m1_cpu_pmu.c
> > @@ -107,12 +107,12 @@ static const u16 m1_pmu_event_affinity[M1_PMU_PERFCTR_LAST + 1] = {
> >  	[M1_PMU_PERFCTR_UNKNOWN_93]	= ONLY_5_6_7,
> >  	[M1_PMU_PERFCTR_UNKNOWN_94]	= ONLY_5_6_7,
> >  	[M1_PMU_PERFCTR_UNKNOWN_95]	= ONLY_5_6_7,
> > -	[M1_PMU_PERFCTR_UNKNOWN_96]	= ONLY_5_6_7,
> > +	[M1_PMU_PERFCTR_UNKNOWN_96]	= BIT(7),
> >  	[M1_PMU_PERFCTR_UNKNOWN_97]	= BIT(7),
> >  	[M1_PMU_PERFCTR_UNKNOWN_98]	= ONLY_5_6_7,
> >  	[M1_PMU_PERFCTR_UNKNOWN_99]	= ONLY_5_6_7,
> >  	[M1_PMU_PERFCTR_UNKNOWN_9a]	= BIT(7),
> > -	[M1_PMU_PERFCTR_UNKNOWN_9b]	= ONLY_5_6_7,
> > +	[M1_PMU_PERFCTR_UNKNOWN_9b]	= BIT(7),
> >  	[M1_PMU_PERFCTR_UNKNOWN_9c]	= ONLY_5_6_7,
> >  	[M1_PMU_PERFCTR_UNKNOWN_9f]	= BIT(7),
> >  	[M1_PMU_PERFCTR_UNKNOWN_bf]	= ONLY_5_6_7,
> 
> It would be great if somebody with access to M1 hardware (and/or any
> PMU insight) could Test or Ack this, please.

I'm a bit concerned by this.

I originally generated this table by hacking the counter setup so that
it would try and count everywhere, and then feed the observations back
into the driver.

So either my methodology was flaky (not unlikely), but I'd then expect
more of these mis-assignments, or this applies to an implementation
that is different from the one I wrote this driver against (the
original M1). Could it be that this for M2 only, and not M1? Or
another flavour of M1?

Either way, it would be good to understand how this has been
established.

In the meantime, I'll try and resurrect my original experiment and see
if I spot the same issue.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.


  reply	other threads:[~2024-07-01 14:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20  3:04 [PATCH v1] drivers/perf: apple_m1: fix affinity table for event 0x96 and 0x9b Yangyu Chen
2024-07-01 14:01 ` Will Deacon
2024-07-01 14:19   ` Marc Zyngier [this message]
2024-07-01 14:43     ` Marc Zyngier
2024-07-02 10:22       ` Yangyu Chen
2024-07-02 10:58         ` Marc Zyngier
2024-07-02 12:13           ` Will Deacon
2024-07-02 12:43             ` Yangyu Chen
2024-07-08 12:00               ` Will Deacon
2024-07-23 16:24                 ` Hector Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cynxp52o.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=asahi@lists.linux.dev \
    --cc=cyy@cyyself.name \
    --cc=j@jannau.net \
    --cc=lina@asahilina.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).