public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman•id.au>
To: Christophe Leroy <christophe.leroy@csgroup•eu>,
	Madhavan Srinivasan <maddy@linux•ibm.com>
Cc: atrajeev@linux•vnet.ibm.com, linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH 5/5] powerpc/perf: use regs->nip when siar is zero
Date: Thu, 22 Oct 2020 12:25:49 +1100	[thread overview]
Message-ID: <87r1prxd9e.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <6ad49bc4-6fc8-0cb9-2228-3da9fea3f0dc@csgroup.eu>

Christophe Leroy <christophe.leroy@csgroup•eu> writes:
> Le 21/10/2020 à 10:53, Madhavan Srinivasan a écrit :
>> In power10 DD1, there is an issue where the
>> Sampled Instruction Address Register (SIAR)
>> not latching to the sampled address during
>> random sampling. This results in value of 0s
>> in the SIAR. Patch adds a check to use regs->nip
>> when SIAR is zero.
>
> Why not use regs->nip at all time in that case, and not read SPRN_SIAR at all ?

Yeah that's a reasonable question.

I can't really find anywhere in the ISA that explains it.

I believe the main (or only?) reason is that interrupts might be
disabled when the PMU samples the instruction. So in that case the SIAR
will point at an instruction somewhere in interrupts-off code, whereas
the NIP will point to the location where we re-enabled interrupts and
took the PMU interrupt.

cheers

  reply	other threads:[~2020-10-22  1:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  8:53 [PATCH 1/5] powerpc/perf: Add new power pmu flag "PPMU_P10_DD1" for power10 DD1 Madhavan Srinivasan
2020-10-21  8:53 ` [PATCH v2 2/5] powerpc/perf: Drop the check for SIAR_VALID Madhavan Srinivasan
2020-10-21  8:53 ` [PATCH 3/5] powerpc/perf: Use the address from SIAR register to set cpumode flags Madhavan Srinivasan
2020-10-21  8:53 ` [PATCH 4/5] powerpc/perf: Exclude kernel samples while counting events in user space Madhavan Srinivasan
2020-10-21  8:53 ` [PATCH 5/5] powerpc/perf: use regs->nip when siar is zero Madhavan Srinivasan
2020-10-21  9:13   ` Christophe Leroy
2020-10-22  1:25     ` Michael Ellerman [this message]
2020-10-27  2:31       ` Madhavan Srinivasan

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=87r1prxd9e.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman$(echo .)id.au \
    --cc=atrajeev@linux$(echo .)vnet.ibm.com \
    --cc=christophe.leroy@csgroup$(echo .)eu \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=maddy@linux$(echo .)ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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