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

Guenter Roeck linux at roeck-us.net
Thu Dec 18 03:03:22 AEDT 2025


Hi,

On Thu, Sep 11, 2025 at 02:30:12PM +0200, Christophe Leroy wrote:
> 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 <christophe.leroy at csgroup.eu>

This patch causes several of my ppc64:ppce500 boot tests with e5500 CPU
to stall.

I have not found a common denominator (the proboem seems independent
of boot media and network interface) , but the problem is repeatable.
Roughtly 50-70% of boot attempts stall.

Reverting this patch fixes the problem.

Bisect log is attached for reference.

Thanks,
Guenter

---
# bad: [8f0b4cce4481fb22653697cced8d0d04027cb1e8] Linux 6.19-rc1
# good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
git bisect start 'HEAD' 'v6.18'
# good: [6dfafbd0299a60bfb5d5e277fdf100037c7ded07] Merge tag 'drm-next-2025-12-03' of https://gitlab.freedesktop.org/drm/kernel
git bisect good 6dfafbd0299a60bfb5d5e277fdf100037c7ded07
# bad: [09cab48db950b6fb8c114314a20c0fd5a80cf990] Merge tag 'soc-arm-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
git bisect bad 09cab48db950b6fb8c114314a20c0fd5a80cf990
# good: [6044a1ee9dca906a807ba786421dc4254191ffd5] Merge tag 'devicetree-for-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
git bisect good 6044a1ee9dca906a807ba786421dc4254191ffd5
# good: [ac20755937e037e586b1ca18a6717d31b1cbce93] Merge tag 'sysctl-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl
git bisect good ac20755937e037e586b1ca18a6717d31b1cbce93
# good: [4b9d25b4d38035b7b2624afd6852dfe4684f0226] Merge tag 'vfs-6.19-rc1.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
git bisect good 4b9d25b4d38035b7b2624afd6852dfe4684f0226
# good: [63a9b0bc65d5d3ea96a57e7985ea22a8582fbbe5] Merge tag 'kvm-riscv-6.19-1' of https://github.com/kvm-riscv/linux into HEAD
git bisect good 63a9b0bc65d5d3ea96a57e7985ea22a8582fbbe5
# good: [e0c26d47def7382d7dbd9cad58bc653aed75737a] Merge tag 'kvm-s390-next-6.19-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
git bisect good e0c26d47def7382d7dbd9cad58bc653aed75737a
# bad: [07025b51c1149951d64804c73014499bb3564dca] Merge tag 'riscv-for-linus-6.19-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
git bisect bad 07025b51c1149951d64804c73014499bb3564dca
# bad: [b296fda58d1d095c95c8207b09856b2ceafa1397] powerpc/64s/hash: Update directMap page counters for Hash
git bisect bad b296fda58d1d095c95c8207b09856b2ceafa1397
# bad: [39fe29e7f2fd38b0fee9bf987d180dee976dd2c7] powerpc: 86xx: Rename wdt@ nodes to watchdog@
git bisect bad 39fe29e7f2fd38b0fee9bf987d180dee976dd2c7
# bad: [10e1c77c3636d815db802ceef588522c2d2d947c] powerpc/32: Fix unpaired stwcx. on interrupt exit
git bisect bad 10e1c77c3636d815db802ceef588522c2d2d947c
# good: [7afe2383eff05f76f4ce2cfda658b7889c89f101] powerpc/kdump: Fix size calculation for hot-removed memory ranges
git bisect good 7afe2383eff05f76f4ce2cfda658b7889c89f101
# bad: [2997876c4a1a5864baa13d7393c2b68cf5b51183] powerpc/32: Restore clearing of MSR[RI] at interrupt/syscall exit
git bisect bad 2997876c4a1a5864baa13d7393c2b68cf5b51183
# good: [98fa236044ca4f8841107382fb03832101fa7328] powerpc/8xx: Remove specific code from fast_exception_return
git bisect good 98fa236044ca4f8841107382fb03832101fa7328
# first bad commit: [2997876c4a1a5864baa13d7393c2b68cf5b51183] powerpc/32: Restore clearing of MSR[RI] at interrupt/syscall exit


More information about the Linuxppc-dev mailing list