From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C31842047A for ; Thu, 13 Aug 2026 06:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786603376; cv=none; b=eMyU0UXw415jHV0OlK0Fy4MXZ2sgKC4FwPwDrALsnTHwdENE97GKmBU8ubhE4VUsX9i22Q6qVoZ2h5rr3gJELiybv06rykUApDeyvktn3Sdni9NLiyldZX+j4L8qOm/xQQm+by+gbsRbzhYPQHj/O7zdZq80twctFIW+zSZ4nmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786603376; c=relaxed/simple; bh=nSiWKPN42SC9/UsEoXGjGEx7iep0cD4AlP0xRnxSoqk=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=LBvp6rDnY7MwcXLJtQxZQQwkBBlGHzb9tfv6gKOV88VXgJ3Inmy713aHpX+QvY2nV4riv03GC9z13m0aZj066J1Nm6L97Cy5RZqiD1PuLHmEafcZI2Y3MCOoHO7zgfkM+mUFY/qEQ4ej/UxcPsyDkkDkFeQDT/BhJIEfFLHhgu0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fm7XyDHp; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fm7XyDHp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C78651F00A3E; Thu, 13 Aug 2026 06:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786603369; bh=uaSzHWaOFN72EaZfiE1M78+a2f7rwDazuDou8bxYOf4=; h=Date:Subject:To:References:From:In-Reply-To; b=Fm7XyDHp2m+zUWtDRROYbmG87+u4zgdweTEKGAH1K85yvgRQMyMxo4QaVfF9mkFQZ MDN7QS83XSckq7+cVR/1DHoYDH7BEg68+ikFk5FGHg+cczKscJAZ9oycWhhInYY1Y+ CDd+Mj1mJCdjTT4e8fD9djNKcbyCnOYDmuHbNYeyDhEtBNGhzLyq4WDfVB6P1jXPn1 X1QssyhHKZ6A4HNp7LSd3PO7BsOKo+zOYlSpzF3M9mNBI7+2beh3wCeAB3Yoz4cr5t IjPBckTWA+SQNsWHWdQLJf2vaDgX51c4ej60yixuM+dDDEAohBufvhGt7g/oMUBKxf r6/PmsDudV/fw== Message-ID: <4e0d3ccc-04b2-41a7-b498-a7f55c18d596@kernel.org> Date: Thu, 13 Aug 2026 08:42:42 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] powerpc/entry: Use hard_irq_disable() in arch_interrupt_exit_prepare() To: Venkat Rao Bagalkote , "Mukesh Kumar Chaurasiya (IBM)" , maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, sshegde@linux.ibm.com, mchauras@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20260812152035.1661781-1-mkchauras@gmail.com> <4882a3cc-30f4-477e-8126-0c244b4a5072@linux.ibm.com> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <4882a3cc-30f4-477e-8126-0c244b4a5072@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 13/08/2026 à 08:36, Venkat Rao Bagalkote a écrit : > > 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 >> Closes: https://eur01.safelinks.protection.outlook.com/? >> url=https%3A%2F%2Flore.kernel.org%2Fall%2F6f9bfb0f-b14c-468e-bb9f- >> c157d120d0dc%40linux.ibm.com%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cf780f6a2abcf425c875808def90533e4%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C639221997929524168%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=kOer%2B610LkQs0ZKBn%2FutIB6j1bMoFasK4DmX4AEWOXA%3D&reserved=0 >> Signed-off-by: Mukesh Kumar Chaurasiya (IBM) >> --- > > > Tested this, and it fixes the reported issue. > > Tested-by: Venkat Rao Bagalkote Didn't you say yesterday [1] that the change doesn't fix the issue ? Did I miss something ? [1] https://lore.kernel.org/all/2f7e6c34-7258-4b20-a38e-cedebccb835f@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)