Skip to contentSkip to conversation

powerpc/64s: Fix comment on interrupt handler prologue

PATCH Superseded Rohan McLure 3 participants 4 messages Jul 25, 2022 – Aug 11, 2022 PowerPC

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 13/14 powerpc/64s: Fix comment on interrupt handler prologue

Interrupt handlers on 64s systems will often need to save register state from the interrupted process to make space for loading special purpose registers or for internal state.

Fix a comment documenting a common code path macro in the beginning of interrupt handlers where r10 is saved to the PACA to afford space for the value of the CFAR. Comment is currently written as if r10-r12 are saved to PACA, but in fact only r10 is saved.

---
V1 -> V2: Given its own commit

---
 arch/powerpc/kernel/exceptions-64s.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/exceptions-64s.S +1 -1
index b66dd6f775a4..102896fc6a86 100644
@@ -281,7 +281,7 @@ BEGIN_FTR_SECTION
 	mfspr	r9,SPRN_PPR
 END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
 	HMT_MEDIUM
-	std	r10,IAREA+EX_R10(r13)		/* save r10 - r12 */
+	std	r10,IAREA+EX_R10(r13)		/* save r10 */
 	.if ICFAR
 BEGIN_FTR_SECTION
 	mfspr	r10,SPRN_CFAR
Signature · 1 line
2.34.1
Reviewed-by on v2 13/14
#1 lore raw
Quoted 6 lines · Rohan McLure

Interrupt handlers on 64s systems will often need to save register state
from the interrupted process to make space for loading special purpose
registers or for internal state.

Quoted 7 lines

Fix a comment documenting a common code path macro in the beginning of
interrupt handlers where r10 is saved to the PACA to afford space for the value of the CFAR. Comment is currently written as if r10-r12 are saved to PACA, but in fact only r10 is saved.

Signature · 2 lines
Andrew Donnellan    OzLabs, ADL Canberra
[email protected]   IBM Australia Limited
#2 lore raw
In reply to Rohan McLure

Le 25/07/2022 à 08:31, Rohan McLure a écrit :

Quoted 8 lines

Interrupt handlers on 64s systems will often need to save register state from the interrupted process to make space for loading special purpose registers or for internal state.

Fix a comment documenting a common code path macro in the beginning of interrupt handlers where r10 is saved to the PACA to afford space for the value of the CFAR. Comment is currently written as if r10-r12 are saved to PACA, but in fact only r10 is saved.

Maybe it would be interesting to know from which patch the error comes.

Quoted 21 lines

---
V1 -> V2: Given its own commit

---
  arch/powerpc/kernel/exceptions-64s.S | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/exceptions-64s.S +1 -1
index b66dd6f775a4..102896fc6a86 100644
@@ -281,7 +281,7 @@ BEGIN_FTR_SECTION
  	mfspr	r9,SPRN_PPR
  END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
  	HMT_MEDIUM
-	std	r10,IAREA+EX_R10(r13)		/* save r10 - r12 */
+	std	r10,IAREA+EX_R10(r13)		/* save r10 */
  	.if ICFAR
  BEGIN_FTR_SECTION
  	mfspr	r10,SPRN_CFAR
#3 lore raw
Quoted 1 line

Maybe it would be interesting to know from which patch the error comes.

It’s hard to attribute this to a single commit, but the distance between r10’s save location and r11-r12’s save location has definitely grown over time. The comment is introduced in commit 7180e3e636de
("[POWERPC] force 64bit mode in fwnmi handlers to workaround firmware bugs”) way back in 2006.

In v3 will insert another comment to better signal where r11-r12 are saved.