From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 22CDC3C3F4A for ; Thu, 13 Aug 2026 06:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786602991; cv=none; b=HgfYCrDab5I1QGaddcg7tyF5FHuAqEO8AceWvsOxVVt+XQO9Dr8yDr5MHwesXAFlI6xu0sEfC/kHp9LWWO6zWmwoDhEYUqZs1ZWCJymiah1wtD1iqhVBkOx/k+at2YNVeuFw8LFxooClDaC/VAWBVJ5v6+5Kmpu2Kotx1eAZND4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786602991; c=relaxed/simple; bh=H2K5iaqaICiF0OZHPs8yqa7XeAbeMjy+HAqdddeqPEI=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=DiqvVw6lmvCjhAvQf9r0gYU2slo2IaT4BZGDQcZYCmtPWBFNs3g0DGUOtp74sWRO5ayvOYV/2bMdyfU2WRcOZGwmw7ZV2KXsaFwu93E7IFMSLiT/cSr4wFhN7SgN+mSBsfQK7wsiGG5wPbv1R/CW8y8M+zmTmoyjQFShoxZMMfU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=eKny6r8g; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="eKny6r8g" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67D61Xh81527710; Thu, 13 Aug 2026 06:36:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=ed6y/H XxdeDh3Xl18To4lBxD4Swf20Md9lnRP23uy+w=; b=eKny6r8gL4BIoj0yH34FYe hJRkqYntg6lyRlKnZ2l8WU5fP9Hm4a+vSgSxs8NPCcmP4G5jKrRn/pW+0Oh/CiP+ EDcXTSqTOpiH57bE9/YfxBpkwY0u8/xPmOfFhPaH0VQWB1EqJcvaLFRbdOkY8Vye yKhFkOvNBpPGdIMc5H24v6QIKrWbuhIwpekPN43kkNx+Sz1mqh7kR/VjLUrF3vXW jS6kL94v4KVbM9/sFeE9gNaFngb54hyy0MMaMOLlws8iff1QGCpJR7G5QKuBPCjk NyWWIpxetxp2IDq4oDiiZZE2yj20F8qyXPUyeTcSd6b5N+1DvOxMKJUulyA5duXQ == Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fwvm9xmjm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Aug 2026 06:36:11 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 67D6QJjM014834; Thu, 13 Aug 2026 06:36:11 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([172.16.1.69]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fxhfy9ng1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Aug 2026 06:36:11 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (smtpav06.wdc07v.mail.ibm.com [10.39.53.233]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 67D6a8tN29885156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Aug 2026 06:36:08 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8845B58056; Thu, 13 Aug 2026 06:36:08 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B31205804E; Thu, 13 Aug 2026 06:36:05 +0000 (GMT) Received: from [9.61.244.175] (unknown [9.61.244.175]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 13 Aug 2026 06:36:05 +0000 (GMT) Message-ID: <4882a3cc-30f4-477e-8126-0c244b4a5072@linux.ibm.com> Date: Thu, 13 Aug 2026 12:06:04 +0530 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: "Mukesh Kumar Chaurasiya (IBM)" , 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 References: <20260812152035.1661781-1-mkchauras@gmail.com> Content-Language: en-GB From: Venkat Rao Bagalkote In-Reply-To: <20260812152035.1661781-1-mkchauras@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODEzMDA0NCBTYWx0ZWRfXx05jEcgQGTPi SsiD25x8z1/dD5v2lesiX+85+bcr99mBHqrEbBL66DY7+QN9xaxIPyh1UjYVvpnoqz1lRauniPP 68RJXg84FAoFk5NZ1T3lmtjJLT4P76Z1LJpv8lNBzDjq9uX+3CRsHdV+dTpnPCGMil6rcXIz1v3 peT8FeqngUGemAGHBbjbN5WSB/HDrSUPorZHONliXcZFHXL76kMgJJGk5PrdaXydgKGbwthtvz0 fdwKk6UUbaA6YgWTNQQdSKK8SSCv8ODnUrKSC/OVU87R8vZlzjTJa0dhbebXaAVtbsiUVGCbde2 S9+CzdpLHZyrHCWvFEW1oK6dah/zYAGFGq3423HNfrXUpB84S5WM18Hj7luh0IifEKHjnCmEkX/ p4350WrDQsV5UI9SsXS3PHtV/4Aqv2jXw+EKb6lbaBOUbmAL7jTEtChadvFydNlNtCT9VL4HeNo 5RGY4Yev/Zp2+MK19xw== X-Proofpoint-ORIG-GUID: 8InQDJ7HrrlUT3mCM3uQJyUg0jBFKI6R X-Proofpoint-Spam-Info: AW1haW4tMjYwODEzMDA0NCBTYWx0ZWRfX+EG7Qg70oDn7 g2za1ARurFTVM5rpXr7B8bKuncYoJBN4EoMDhwaetMB8YzLhT241OyY6aJVcLBFiXyhxQjigQJh 34lMefmCVPH+0h+PNiWTJmlvhNJO4qo= X-Authority-Analysis: v=2.4 cv=IfK3n2qa c=1 sm=1 tr=0 ts=6a7d65dc cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=pGLkceISAAAA:8 a=2I_y1vSCpsRrOs2zh8UA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: 6kwpSNPETsVGE9emirRxjTwcMviuwaDa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-13_02,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608130044 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://lore.kernel.org/all/6f9bfb0f-b14c-468e-bb9f-c157d120d0dc@linux.ibm.com/ > Signed-off-by: Mukesh Kumar Chaurasiya (IBM) > --- Tested this, and it fixes the reported issue. Tested-by: Venkat Rao Bagalkote 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)