mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
To: "Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>,
	maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
	chleroy@kernel.org, sshegde@linux.ibm.com,
	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: Thu, 13 Aug 2026 12:06:04 +0530	[thread overview]
Message-ID: <4882a3cc-30f4-477e-8126-0c244b4a5072@linux.ibm.com> (raw)
In-Reply-To: <20260812152035.1661781-1-mkchauras@gmail.com>


On 12/08/26 8:50 pm, Mukesh Kumar Chaurasiya (IBM) wrote:
> commit 334f3f6d7a16 ("powerpc/entry: Disable interrupts before irqentry_exit")
> fixed a BUG in preempt_schedule_irq() by calling local_irq_disable()
> unconditionally in arch_interrupt_exit_prepare() before irqentry_exit().
> The fix is correct in intent but uses the wrong primitive for PPC64.
>
> On PPC64, local_irq_disable() only sets the soft-mask
> (irq_soft_mask = IRQS_DISABLED). It does not set PACA_IRQ_HARD_DIS in
> irq_happened and does not clear MSR[EE].
>
> This causes a continuous WARN_ON boot hang on Power11 pSeries LPARs
> using the dedicated-cede cpuidle path. When the CPU wakes from H_CEDE,
> interrupt_exit_kernel_prepare() calls replay_soft_interrupts(), which
> dispatches pending async handlers (timer_interrupt, do_IRQ) using the
> DEFINE_INTERRUPT_HANDLER_ASYNC macro. That macro calls
> arch_interrupt_async_exit_prepare() -> arch_interrupt_exit_prepare()
> before irqentry_exit(). With local_irq_disable(), PACA_IRQ_HARD_DIS
> is not set, but next_interrupt() unconditionally asserts it:
>
>    WARN_ON(!(local_paca->irq_happened & PACA_IRQ_HARD_DIS));
>
> This fires on every replayed interrupt, looping indefinitely and
> preventing boot completion.
>
> Fix this by replacing local_irq_disable() with hard_irq_disable().
> On PPC64, hard_irq_disable() sets irq_soft_mask to IRQS_ALL_DISABLED,
> sets PACA_IRQ_HARD_DIS in irq_happened, and clears MSR[EE] — satisfying
> all of:
>
>    - lockdep_assert_irqs_disabled() in irqentry_exit_to_kernel_mode()
>    - next_interrupt()'s WARN_ON(!(irq_happened & PACA_IRQ_HARD_DIS))
>    - preempt_schedule_irq()'s BUG_ON(!irqs_disabled())
>
> On PPC32/non-64, hard_irq_disable() is equivalent to local_irq_disable(),
> so there is no regression on those platforms.
>
> Fixes: 334f3f6d7a16 ("powerpc/entry: Disable interrupts before irqentry_exit")
> Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
> Closes: https://lore.kernel.org/all/6f9bfb0f-b14c-468e-bb9f-c157d120d0dc@linux.ibm.com/
> Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
> ---


Tested this, and it fixes the reported issue.

Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>


Regards,

Venkat.


>   arch/powerpc/include/asm/entry-common.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/entry-common.h b/arch/powerpc/include/asm/entry-common.h
> index c5adb5006361..de64389b0815 100644
> --- a/arch/powerpc/include/asm/entry-common.h
> +++ b/arch/powerpc/include/asm/entry-common.h
> @@ -270,7 +270,7 @@ static inline void arch_interrupt_exit_prepare(struct pt_regs *regs)
>   	}
>   
>   	/* irqentry_exit expects to be called with interrupts disabled */
> -	local_irq_disable();
> +	hard_irq_disable();
>   }
>   
>   static inline void arch_interrupt_async_enter_prepare(struct pt_regs *regs)

  reply	other threads:[~2026-08-13  6:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 15:20 Mukesh Kumar Chaurasiya (IBM)
2026-08-13  6:36 ` Venkat Rao Bagalkote [this message]
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

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=4882a3cc-30f4-477e-8126-0c244b4a5072@linux.ibm.com \
    --to=venkat88@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=sshegde@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

all inboxes | Powered by JetHome®