* [PATCH] powerpc/32: Restore clearing of MSR[RI] in interrupt_exit_kernel_prepare()
@ 2025-09-01 10:37 Christophe Leroy
2025-09-03 9:28 ` Christophe Leroy
0 siblings, 1 reply; 2+ messages in thread
From: Christophe Leroy @ 2025-09-01 10:37 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Madhavan Srinivasan
Cc: Christophe Leroy, linux-kernel, linuxppc-dev
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.
Fixes: 13799748b957 ("powerpc/64: use interrupt restart table to speed up return from interrupt")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/kernel/interrupt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index e0c681d0b076..e63bfde13e03 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -443,6 +443,9 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
if (unlikely(stack_store))
__hard_EE_RI_disable();
+#else
+ } else {
+ __hard_EE_RI_disable();
#endif /* CONFIG_PPC64 */
}
--
2.49.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/32: Restore clearing of MSR[RI] in interrupt_exit_kernel_prepare()
2025-09-01 10:37 [PATCH] powerpc/32: Restore clearing of MSR[RI] in interrupt_exit_kernel_prepare() Christophe Leroy
@ 2025-09-03 9:28 ` Christophe Leroy
0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy @ 2025-09-03 9:28 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Madhavan Srinivasan
Cc: linux-kernel, linuxppc-dev
Le 01/09/2025 à 12:37, Christophe Leroy a écrit :
> 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.
This is needed but not enough. A synchronisation instruction is needed
after clearing MSR[RI], otherwise the Instruction Breakpoint still
triggers on a few instructions passed clearing of RI, allthough the
LCTRL2[BRKNOMSK] is unset, meaning "Masked mode, breakpoints are
recognized only when MSR[RI] =1 (reset value)"
We could as a isync() after __hard_EE_RI_disable(), but to minimise the
impact it will be better to move clearing of MSR[RI] in the low-level
assembly part of interrupt exit, just before the mtspr to SRR0 and SRR1,
as was done before commit 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@csgroup.eu>
> ---
> arch/powerpc/kernel/interrupt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
> index e0c681d0b076..e63bfde13e03 100644
> --- a/arch/powerpc/kernel/interrupt.c
> +++ b/arch/powerpc/kernel/interrupt.c
> @@ -443,6 +443,9 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
>
> if (unlikely(stack_store))
> __hard_EE_RI_disable();
> +#else
> + } else {
> + __hard_EE_RI_disable();
> #endif /* CONFIG_PPC64 */
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-03 9:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-01 10:37 [PATCH] powerpc/32: Restore clearing of MSR[RI] in interrupt_exit_kernel_prepare() Christophe Leroy
2025-09-03 9:28 ` Christophe Leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®