Thread (15 messages) 15 messages, 3 authors, 2025-12-11

Re: [PPC] [e5500] Boot issues after the PowerPC updates 6.19-1

From: Christian Zigotzky <hidden>
Date: 2025-12-09 10:23:48

On 09 December 2025 at 10:03 am, Christian Zigotzky [off-list ref] wrote:

I bisected today.

1. git clone https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git -b powerpc-6.19-1 a

2. cd a

3. git log

Output:

commit 9b36c7fc5aa5f2c6e6eeb9f312fdfe61b4291c9f (HEAD, tag: powerpc-6.19-1, origin/next-test, origin/next)

...

4. git bisect start

5. git bisect good f850568efe3a7a9ec4df357cfad1f997f0058924

Merge tag 'i2c-for-6.18-rc5'

6. git bisect bad 9b36c7fc5aa5f2c6e6eeb9f312fdfe61b4291c9f

macintosh/via-pmu-backlight: Include <linux/fb.h> and <linux/of.h>

7. git bisect bad

8. git bisect bad

9. git bisect good

10. git bisect bad

11. git bisect good

2997876c4a1a5864baa13d7393c2b68cf5b51183 is the first bad commit
commit 2997876c4a1a5864baa13d7393c2b68cf5b51183
Author: Christophe Leroy [off-list ref]
Date:   Thu Sep 11 14:30:12 2025 +0200

   powerpc/32: Restore clearing of MSR[RI] at interrupt/syscall exit

   Commit 13799748b957 ("powerpc/64: use interrupt restart table to speed
   up return from interrupt") removed the inconditional clearing of
   MSR[RI] when returning from interrupt into kernel. But powerpc/32
   doesn't implement interrupt restart table hence still need MSR[RI]
   to be cleared.

   It could be added back in interrupt_exit_kernel_prepare() but it is
   easier and better to add it back in entry_32.S for following reasons:
   - Writing to MSR must be followed by a synchronising instruction
   - The smaller the non recoverable section is the better it is

   So add a macro called clr_ri and use it in the three places that play
   up with SRR0/SRR1. Use it just before another mtspr for synchronisation
   to avoid having to add an isync.

   Now that's done in entry_32.S, exit_must_hard_disable() can return
   false for non book3s/64, taking into account that BOOKE doesn't have
   MSR_RI.

   Also add back blacklisting syscall_exit_finish for kprobe. This was
   initially added by commit 7cdf44013885 ("powerpc/entry32: Blacklist
   syscall exit points for kprobe.") then lost with
   commit 6f76a01173cc ("powerpc/syscall: implement system call
   entry/exit logic in C for PPC32").

   Fixes: 6f76a01173cc ("powerpc/syscall: implement system call entry/exit logic in C for PPC32")
   Fixes: 13799748b957 ("powerpc/64: use interrupt restart table to speed up return from interrupt")
   Signed-off-by: Christophe Leroy [off-list ref]
   Signed-off-by: Madhavan Srinivasan [off-list ref]
   Link: https://patch.msgid.link/66d0ab070563ad460ed481328ab0887c27f21a2c.1757593807.git.christophe.leroy@csgroup.eu

arch/powerpc/kernel/entry_32.S  | 18 +++++++++++++++++-
arch/powerpc/kernel/interrupt.c |  2 +-
2 files changed, 18 insertions(+), 2 deletions(-)

12. git revert 2997876c4a1a5864baa13d7393c2b68cf5b51183

After reverting the first bad commit, the kernel boots without any problems.
I created a patch for reverting the first bad commit.

After patching, the kernel boots without any problems.

diff -rupN a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
--- a/arch/powerpc/kernel/entry_32.S	2025-12-09 06:57:20.681347393 +0100
+++ b/arch/powerpc/kernel/entry_32.S	2025-12-09 10:24:37.357301725 +0100
@@ -101,17 +101,6 @@ SYM_FUNC_END(__kuep_unlock)
 .endm
 #endif
 
-.macro	clr_ri trash
-#ifndef CONFIG_BOOKE
-#ifdef CONFIG_PPC_8xx
-	mtspr   SPRN_NRI, \trash
-#else
-	li	\trash, MSR_KERNEL & ~MSR_RI
-	mtmsr	\trash
-#endif
-#endif
-.endm
-
 	.globl	transfer_to_syscall
 transfer_to_syscall:
 	stw	r3, ORIG_GPR3(r1)
@@ -160,7 +149,6 @@ ret_from_syscall:
 	cmpwi	r3,0
 	REST_GPR(3, r1)
 syscall_exit_finish:
-	clr_ri	r4
 	mtspr	SPRN_SRR0,r7
 	mtspr	SPRN_SRR1,r8
 
@@ -180,7 +168,6 @@ syscall_exit_finish:
 	REST_GPR(0, r1)
 	REST_GPRS(3, 12, r1)
 	b	1b
-_ASM_NOKPROBE_SYMBOL(syscall_exit_finish)
 
 #ifdef CONFIG_44x
 .L44x_icache_flush:
@@ -237,11 +224,10 @@ fast_exception_return:
 	/* Clear the exception marker on the stack to avoid confusing stacktrace */
 	li	r10, 0
 	stw	r10, 8(r11)
-	clr_ri	r10
+	REST_GPR(10, r11)
 	mtspr	SPRN_SRR1,r9
 	mtspr	SPRN_SRR0,r12
 	REST_GPR(9, r11)
-	REST_GPR(10, r11)
 	REST_GPR(12, r11)
 	REST_GPR(11, r11)
 	rfi
@@ -270,7 +256,6 @@ interrupt_return:
 .Lfast_user_interrupt_return:
 	lwz	r11,_NIP(r1)
 	lwz	r12,_MSR(r1)
-	clr_ri	r4
 	mtspr	SPRN_SRR0,r11
 	mtspr	SPRN_SRR1,r12
 
@@ -313,7 +298,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRE
 	cmpwi	cr1,r3,0
 	lwz	r11,_NIP(r1)
 	lwz	r12,_MSR(r1)
-	clr_ri	r4
 	mtspr	SPRN_SRR0,r11
 	mtspr	SPRN_SRR1,r12
 
diff -rupN a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
--- a/arch/powerpc/kernel/interrupt.c	2025-12-09 06:57:20.717347165 +0100
+++ b/arch/powerpc/kernel/interrupt.c	2025-12-09 10:24:37.357301725 +0100
@@ -38,7 +38,7 @@ static inline bool exit_must_hard_disabl
 #else
 static inline bool exit_must_hard_disable(void)
 {
-	return false;
+	return true;
 }
 #endif
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help