linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] powerpc/perf: Use SIER_USER_MASK while updating SPRN_SIER for EBB events
@ 2020-03-13 17:49 Athira Rajeev
  2020-03-13 18:06 ` Segher Boessenkool
  0 siblings, 1 reply; 3+ messages in thread
From: Athira Rajeev @ 2020-03-13 17:49 UTC (permalink / raw)
  To: mpe; +Cc: maddy, linuxppc-dev

Sampled instruction address register (SIER), is a PMU register,
captures architecture state for a given sample. And sier_user_mask
defined in commit 330a1eb7775b ("powerpc/perf: Core EBB support for 64-bit
book3s") defines the architected bits that needs to be saved from the SPR.
Currently all of the bits from SIER are saved for EBB events. Patch fixes
this by ANDing the "sier_user_mask" to data from SIER in ebb_switch_out().
This will force save only architected bits from the SIER.

Fixes: 330a1eb7775b ("powerpc/perf: Core EBB support for 64-bit book3s")
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
Changes in v2:
  - Make the commit message more clearer.

 arch/powerpc/perf/core-book3s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 3086055..48b61cc 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -579,7 +579,7 @@ static void ebb_switch_out(unsigned long mmcr0)
 		return;
 
 	current->thread.siar  = mfspr(SPRN_SIAR);
-	current->thread.sier  = mfspr(SPRN_SIER);
+	current->thread.sier  = mfspr(SPRN_SIER) & SIER_USER_MASK;
 	current->thread.sdar  = mfspr(SPRN_SDAR);
 	current->thread.mmcr0 = mmcr0 & MMCR0_USER_MASK;
 	current->thread.mmcr2 = mfspr(SPRN_MMCR2) & MMCR2_USER_MASK;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] powerpc/perf: Use SIER_USER_MASK while updating SPRN_SIER for EBB events
  2020-03-13 17:49 [PATCH v2] powerpc/perf: Use SIER_USER_MASK while updating SPRN_SIER for EBB events Athira Rajeev
@ 2020-03-13 18:06 ` Segher Boessenkool
  2020-03-18 12:00   ` Athira Rajeev
  0 siblings, 1 reply; 3+ messages in thread
From: Segher Boessenkool @ 2020-03-13 18:06 UTC (permalink / raw)
  To: Athira Rajeev; +Cc: maddy, linuxppc-dev

On Fri, Mar 13, 2020 at 01:49:07PM -0400, Athira Rajeev wrote:
> Sampled instruction address register (SIER), is a PMU register,

SIER stands for "Sampled Instruction Event Register", instead.  With that
change, your patch is totally clear :-)


Segher

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] powerpc/perf: Use SIER_USER_MASK while updating SPRN_SIER for EBB events
  2020-03-13 18:06 ` Segher Boessenkool
@ 2020-03-18 12:00   ` Athira Rajeev
  0 siblings, 0 replies; 3+ messages in thread
From: Athira Rajeev @ 2020-03-18 12:00 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: maddy, linuxppc-dev



> On 13-Mar-2020, at 11:36 PM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> 
> On Fri, Mar 13, 2020 at 01:49:07PM -0400, Athira Rajeev wrote:
>> Sampled instruction address register (SIER), is a PMU register,
> 
> SIER stands for "Sampled Instruction Event Register", instead.  With that
> change, your patch is totally clear :-)
> 

Hi Segher,

Thanks for reviewing. My bad. I am sending a V3 with the register name corrected in the commit message.

Athira 

> 
> Segher


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-18 12:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 17:49 [PATCH v2] powerpc/perf: Use SIER_USER_MASK while updating SPRN_SIER for EBB events Athira Rajeev
2020-03-13 18:06 ` Segher Boessenkool
2020-03-18 12:00   ` Athira Rajeev

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).