Skip to contentSkip to conversation

powerpc/perf: Use SIER_USER_MASK while updating SPRN_SIER for EBB events

PATCH Superseded Athira Rajeev 2 participants 3 messages Mar 13, 2020 – Mar 18, 2020 PowerPC

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc/perf: Use SIER_USER_MASK while updating SPRN_SIER for EBB events

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

---
Changes in v2:
- Make the commit message more clearer.

 arch/powerpc/perf/core-book3s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/perf/core-book3s.c +1 -1
index 3086055..48b61cc 100644
@@ -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;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 1 line · Athira Rajeev

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

#2 lore raw
Quoted 10 lines · Segher Boessenkool
Quoted 1 line · Athira Rajeev

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

Quoted 2 lines

Segher