From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Mukesh Kumar Chaurasiya <mkchauras@gmail.com>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Cc: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
chleroy@kernel.org, mchauras@linux.ibm.com,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/entry: Use hard_irq_disable() in arch_interrupt_exit_prepare()
Date: Wed, 19 Aug 2026 16:22:31 +0530 [thread overview]
Message-ID: <d9c19203-a9d8-4815-9f60-97e7411976e4@linux.ibm.com> (raw)
In-Reply-To: <aoVrvjiSMmEDbwIF@li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com>
On 8/19/26 2:16 PM, Mukesh Kumar Chaurasiya wrote:
> 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.
>
Venkat,
Can you collect vmcore with panic on warning enabled?
It maybe nested replay of soft interrupts which maybe causing problems
here. We should see the regs state.
> Regards,
> Mukesh
next prev parent reply other threads:[~2026-08-19 10:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 15:20 [PATCH] powerpc/entry: Use hard_irq_disable() in arch_interrupt_exit_prepare() Mukesh Kumar Chaurasiya (IBM)
2026-08-13 6:36 ` Venkat Rao Bagalkote
2026-08-13 6:42 ` Christophe Leroy (CS GROUP)
2026-08-13 7:59 ` Venkat Rao Bagalkote
2026-08-14 5:36 ` Shrikanth Hegde
2026-08-14 6:12 ` Mukesh Kumar Chaurasiya
2026-08-15 4:57 ` Mukesh Kumar Chaurasiya
2026-08-19 5:54 ` Venkat Rao Bagalkote
2026-08-19 8:46 ` Mukesh Kumar Chaurasiya
2026-08-19 10:52 ` Shrikanth Hegde [this message]
2026-08-20 4:53 ` Mukesh Kumar Chaurasiya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d9c19203-a9d8-4815-9f60-97e7411976e4@linux.ibm.com \
--to=sshegde@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mchauras@linux.ibm.com \
--cc=mkchauras@gmail.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=venkat88@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox