Re: [PATCH] powerpc/entry: Use hard_irq_disable() in arch_interrupt_exit_prepare()
From: Mukesh Kumar Chaurasiya
Date: Wed Aug 19 2026 - 04:46:27 EST
On Wed, Aug 19, 2026 at 11:24:40AM +0530, Venkat Rao Bagalkote wrote:
>
[...]
> > Hey Venkat,
> >
> > Can you try this diff,
> >
> > diff --git a/arch/powerpc/kernel/irq_64.c b/arch/powerpc/kernel/irq_64.c
> > index d5c48d1b0a31..2fbfebef74fe 100644
> > --- a/arch/powerpc/kernel/irq_64.c
> > +++ b/arch/powerpc/kernel/irq_64.c
> > @@ -117,7 +117,7 @@ static __no_kcsan void __replay_soft_interrupts(void)
> > local_paca->irq_happened |= PACA_IRQ_REPLAYING;
> > ppc_save_regs(®s);
> > - regs.softe = IRQS_ENABLED;
> > + regs.softe = IRQS_DISABLED;
> > regs.msr |= MSR_EE;
> > /*
> >
> Hello Mukesh,
>
> With the proposed change, I still the issue.
>
> [ 0.742633] ------------[ cut here ]------------
> [ 0.742633] WARNING: arch/powerpc/kernel/irq_64.c:75 at
> __replay_soft_interrupts+0x104/0x220, CPU#6: swapper/0/1
> [ 0.742637] Modules linked in:
> [ 0.742638] CPU: 6 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W
> 7.2.0-rc7-dirty #25 PREEMPT
> [ 0.742639] Tainted: [W]=WARN
> [ 0.742640] Hardware name: IBM,9080-HEX Power11 (architected) 0x820200
> 0xf000007 of:IBM,FW1110.01 (NH1110_069) hv:phyp pSeries
> [ 0.742641] NIP: c00000000003a384 LR: c00000000003a360 CTR:
> c000000000029f00
> [ 0.742642] REGS: c000000009757410 TRAP: 0700 Tainted: G W
> (7.2.0-rc7-dirty)
> [ 0.742643] MSR: 8000000002021033 <SF,VEC,ME,IR,DR,RI,LE> CR: 88024824
> XER: 00000003
> [ 0.742646] CFAR: c00000000002a708 IRQMASK: 1
> [ 0.742646] GPR00: c00000000003a360 c0000000097576b0 c000000001b28100
> c0000000097576d8
> [ 0.742646] GPR04: 0000000000000000 0000000000000001 c00000000968d200
> c0000000096eb200
> [ 0.742646] GPR08: 0000000000000001 0000000000000041 0000000000000001
> 000000002c1b8100
> [ 0.742646] GPR12: c000000000029f00 c0000005ffff8f00 0000000000000000
> c00000000968d200
> [ 0.742646] GPR16: c000000002f3aaf8 0000000000000000 c00000000284e138
> 0000000000000000
> [ 0.742646] GPR20: c00000000303aaf8 c00000000303ade8 0000000000000001
> 0000000000000000
> [ 0.742646] GPR24: c00000000303ae08 0000000000000000 0000000000000000
> 0000000000000002
> [ 0.742646] GPR28: 0000000000000003 fcffffffffffffff fcffffffffffffff
> c00000000968d200
> [ 0.742662] NIP [c00000000003a384] __replay_soft_interrupts+0x104/0x220
> [ 0.742665] LR [c00000000003a360] __replay_soft_interrupts+0xe0/0x220
> [ 0.742668] Call Trace:
> [ 0.742668] [c0000000097576b0] [c00000000003a360]
> __replay_soft_interrupts+0xe0/0x220 (unreliable)
> [ 0.742672] [c000000009757860] [c00000000003a694]
> arch_local_irq_restore+0x1f4/0x2d8
> [ 0.742675] [c0000000097578b0] [c0000000002face0]
> console_flush_all+0x3ec/0x558
> [ 0.742676] [c000000009757a00] [c0000000002faee4]
> console_unlock+0x98/0x1d8
> [ 0.742678] [c000000009757a80] [c0000000002fc698]
> vprintk_emit+0x2c0/0x3f4
> [ 0.742680] [c000000009757af0] [c0000000002fdc70] vprintk+0x30/0x7c
> [ 0.742682] [c000000009757b10] [c0000000002f6c78] _printk+0x3c/0x50
> [ 0.742683] [c000000009757b30] [c00000000205d814]
> load_system_certificate_list+0x24/0x5c
> [ 0.742685] [c000000009757b90] [c00000000001111c]
> do_one_initcall+0x5c/0x3f0
> [ 0.742687] [c000000009757c70] [c00000000200684c]
> do_initcalls+0x11c/0x270
> [ 0.742689] [c000000009757d30] [c000000002006c78]
> kernel_init_freeable+0x228/0x3c0
> [ 0.742690] [c000000009757de0] [c000000000011600] kernel_init+0x30/0x260
>
> [ 0.742692] [c000000009757e50] [c00000000000df7c]
> ret_from_kernel_user_thread+0x14/0x1c
>
>
> Regards,
>
> Venkat.
>
Hey Venkat,
Thanks for verifying.
The regs.softe = IRQS_DISABLED change only prevents
irqentry_exit_cond_resched() preemption path from running — it does nothing
about PACA_IRQ_HARD_DIS being cleared by the handler and not restored.
hard_irq_disable() fixes both: it atomically sets PACA_IRQ_HARD_DIS, sets
irq_soft_mask = IRQS_ALL_DISABLED, and clears MSR[EE], leaving a fully
consistent disabled state that next_interrupt() expects, regardless of
which entry path (idle wakeup or irqrestore) triggered the replay.
To answer's shrikanth question
it worked before because there was literally no interrupt-disabling code
on the handler exit path during replay. The new GENERIC_ENTRY
infrastructure brought a real exit sequence with it, and that sequence
needs hard_irq_disable() — not local_irq_disable() — to keep PPC64's
two-level interrupt state (irq_soft_mask + PACA_IRQ_HARD_DIS) consistent.
Hey Madhavan,
I think we are ok with this patch if there are no more objections from
anyone.
Regards,
Mukesh