Thread (149 messages) 149 messages, 20 authors, 2025-11-13

Re: [FSL P50x0] Xorg always restarts again and again after the the PowerPC updates 5.13-1

From: Christian Zigotzky <hidden>
Date: 2021-05-14 00:20:27

On 14 May 2021 at 00:58am, Nicholas Piggin wrote:
quoted hunk ↗ jump to hunk
Excerpts from Christian Zigotzky's message of May 14, 2021 6:20 am:
quoted
On 13 May 2021 at 07:00pm, Christophe Leroy wrote:
quoted
Ah yes, I remember this problem.

Can you select CONFIG_VIRT_CPU_ACCOUNTING_GEN in your configuration ?

Otherwise, I can try to fix the branch.

Christophe
I selected this. After that it compiles.

1. git bisect good - Xorg restarts again and again
      Output: [f9aa0ac1e9e82b60401ad567bdabc30598325bc1] Revert
"powerpc/64e/interrupt: use new interrupt return"
2. git bisect good - Xorg restarts again and again
      Output: [cd6d259a14704741bf0cd1dcadb84c0de22d7f77] Revert
"powerpc/64e/interrupt: always save nvgprs on interrupt"
3. git bisect bad - Xorg works
      Output: [9bfa20ef2ae54d3b9088dfbcde4ef97062cf5ef2] Revert
"powerpc/interrupt: update common interrupt code for"
4. git bisect good - Xorg restarts again and again
      Output:

cd6d259a14704741bf0cd1dcadb84c0de22d7f77 is the first bad commit
commit cd6d259a14704741bf0cd1dcadb84c0de22d7f77
Author: Christophe Leroy [off-list ref]
Date:   Thu May 13 09:52:06 2021 +0000

      Revert "powerpc/64e/interrupt: always save nvgprs on interrupt"

      This reverts commit 4228b2c3d20e9f80b847f809c38e6cf82864fa50.

:040000 040000 156542c857ad72776b69bb67b2f244afeeb7abd3
92ea86ed097fce16238b0c2f2b343473894e4e8e M    arch
Thank you both very much for chasing this down.

I think I see the problem, it's clobbering r14 and r15 for some
interrupts. Something like this is required, I'll give it more
review and testing though.

Thanks,
Nick

---
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 7c3654b0d0f4..b91ef04f1ce2 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -535,6 +535,10 @@ __end_interrupts:
  				PROLOG_ADDITION_2REGS)
  	mfspr	r14,SPRN_DEAR
  	mfspr	r15,SPRN_ESR
+	std	r14,_DAR(r1)
+	std	r15,_DSISR(r1)
+	ld	r14,PACA_EXGEN+EX_R14(r13)
+	ld	r15,PACA_EXGEN+EX_R15(r13)
  	EXCEPTION_COMMON(0x300)
  	b	storage_fault_common
  
@@ -544,6 +548,10 @@ __end_interrupts:
  				PROLOG_ADDITION_2REGS)
  	li	r15,0
  	mr	r14,r10
+	std	r14,_DAR(r1)
+	std	r15,_DSISR(r1)
+	ld	r14,PACA_EXGEN+EX_R14(r13)
+	ld	r15,PACA_EXGEN+EX_R15(r13)
  	EXCEPTION_COMMON(0x400)
  	b	storage_fault_common
  
@@ -557,6 +565,10 @@ __end_interrupts:
  				PROLOG_ADDITION_2REGS)
  	mfspr	r14,SPRN_DEAR
  	mfspr	r15,SPRN_ESR
+	std	r14,_DAR(r1)
+	std	r15,_DSISR(r1)
+	ld	r14,PACA_EXGEN+EX_R14(r13)
+	ld	r15,PACA_EXGEN+EX_R15(r13)
  	EXCEPTION_COMMON(0x600)
  	b	alignment_more	/* no room, go out of line */
  
@@ -565,10 +577,10 @@ __end_interrupts:
  	NORMAL_EXCEPTION_PROLOG(0x700, BOOKE_INTERRUPT_PROGRAM,
  				PROLOG_ADDITION_1REG)
  	mfspr	r14,SPRN_ESR
-	EXCEPTION_COMMON(0x700)
  	std	r14,_DSISR(r1)
-	addi	r3,r1,STACK_FRAME_OVERHEAD
  	ld	r14,PACA_EXGEN+EX_R14(r13)
+	EXCEPTION_COMMON(0x700)
+	addi	r3,r1,STACK_FRAME_OVERHEAD
  	bl	program_check_exception
  	REST_NVGPRS(r1)
  	b	interrupt_return
@@ -725,11 +737,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
  	 * normal exception
  	 */
  	mfspr	r14,SPRN_DBSR
-	EXCEPTION_COMMON_CRIT(0xd00)
  	std	r14,_DSISR(r1)
-	addi	r3,r1,STACK_FRAME_OVERHEAD
  	ld	r14,PACA_EXCRIT+EX_R14(r13)
  	ld	r15,PACA_EXCRIT+EX_R15(r13)
+	EXCEPTION_COMMON_CRIT(0xd00)
+	addi	r3,r1,STACK_FRAME_OVERHEAD
  	bl	DebugException
  	REST_NVGPRS(r1)
  	b	interrupt_return
@@ -796,11 +808,11 @@ kernel_dbg_exc:
  	 * normal exception
  	 */
  	mfspr	r14,SPRN_DBSR
-	EXCEPTION_COMMON_DBG(0xd08)
  	std	r14,_DSISR(r1)
-	addi	r3,r1,STACK_FRAME_OVERHEAD
  	ld	r14,PACA_EXDBG+EX_R14(r13)
  	ld	r15,PACA_EXDBG+EX_R15(r13)
+	EXCEPTION_COMMON_DBG(0xd08)
+	addi	r3,r1,STACK_FRAME_OVERHEAD
  	bl	DebugException
  	REST_NVGPRS(r1)
  	b	interrupt_return
@@ -931,11 +943,7 @@ masked_interrupt_book3e_0x2c0:
   * original values stashed away in the PACA
   */
  storage_fault_common:
-	std	r14,_DAR(r1)
-	std	r15,_DSISR(r1)
  	addi	r3,r1,STACK_FRAME_OVERHEAD
-	ld	r14,PACA_EXGEN+EX_R14(r13)
-	ld	r15,PACA_EXGEN+EX_R15(r13)
  	bl	do_page_fault
  	b	interrupt_return
  
@@ -944,11 +952,7 @@ storage_fault_common:
   * continues here.
   */
  alignment_more:
-	std	r14,_DAR(r1)
-	std	r15,_DSISR(r1)
  	addi	r3,r1,STACK_FRAME_OVERHEAD
-	ld	r14,PACA_EXGEN+EX_R14(r13)
-	ld	r15,PACA_EXGEN+EX_R15(r13)
  	bl	alignment_exception
  	REST_NVGPRS(r1)
  	b	interrupt_return
Hi Nicholas,

I compiled the RC1 with your patch today and Xorg works without any 
problems.

Many thanks! It was a long way.

Cheers,
Christian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help