Re: [PATCH] powerpc/970: fix nap return address corruption on async interrupt exit
From: Mukesh Kumar Chaurasiya <hidden>
Date: 2026-07-08 05:34:53
Also in:
lkml
On Wed, Jul 08, 2026 at 09:57:44AM +0530, Shrikanth Hegde wrote:
Hi Mukesh. On 7/7/26 10:54 PM, Mukesh Kumar Chaurasiya (IBM) wrote:
<... snip ...>
quoted
/* Can avoid a test-and-clear because NMIs do not call this */ clear_thread_local_flags(_TLF_NAPPING);@@ -286,14 +293,6 @@ static inline void arch_interrupt_async_enter_prepare(struct pt_regs *regs) static inline void arch_interrupt_async_exit_prepare(struct pt_regs *regs) { - /* - * Adjust at exit so the main handler sees the true NIA. This must - * come before irq_exit() because irq_exit can enable interrupts, and - * if another interrupt is taken before nap_adjust_return has run - * here, then that interrupt would return directly to idle nap return. - */ - nap_adjust_return(regs); - arch_interrupt_exit_prepare(regs); }This makes arch_interrupt_async_exit_prepare same as arch_interrupt_exit_prepare. Maybe remove arch_interrupt_async_exit_prepare?
Hey, `arch_interrupt_async_exit_prepare` and `arch_interrupt_exit_prepare`, both are marked static inline. So the generated assembly will have no impact. I kept it this way coz it was consistent with how we implemented other macros like `DEFINE_INTERRUPT_HANDLER`. Regards, Mukesh
quoted
diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h index fb42a664ae54..1b45a49e9bed 100644 --- a/arch/powerpc/include/asm/interrupt.h +++ b/arch/powerpc/include/asm/interrupt.h@@ -246,6 +246,7 @@ interrupt_handler void func(struct pt_regs *regs) \ instrumentation_begin(); \ irq_enter_rcu(); \ ____##func (regs); \ + nap_adjust_return(regs); \ irq_exit_rcu(); \ instrumentation_end(); \ arch_interrupt_async_exit_prepare(regs); \