From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B2B835201B for ; Wed, 12 Aug 2026 15:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786548047; cv=none; b=b7eC7+zNG3OqUUzWvhPpXjvsF4TGvNTiBSth8EP4A/p090GfOIw98brT0HqYYkIrFcjCDmcai5oiOQb/t3nnzP2DG7bNqM2/7I5/GRwz4pcqpcCR9Gi0lKxW7XKJIl28sUPKk2B99+J7n9kFdD/WNa7dylN2kZsh3cq1Hpt8Awk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786548047; c=relaxed/simple; bh=PJDFdk4iEnt7//eLsxoXIiakEo2vg6cQ+oBZeFrmMUA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=oVMR+tgb6w1Z+8lphsecZ/56HfwXDiBiudYn2cNOSHoCq0jUIckUAn7Abbk6wRmyLna0J4prxSQLh4mam4MAMj1a6S/MV5v6Qe0S6jJprBRepmNQaiyQ4wMIcVOegXPnqexPSyjL3+ODbtm2KiwlVvPIHPqzFE+kZGKr6AQsu7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=idXxOLIN; arc=none smtp.client-ip=209.85.216.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="idXxOLIN" Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-38fdeaed181so1479333a91.1 for ; Wed, 12 Aug 2026 08:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786548045; x=1787152845; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=craqyBqdnDvM4zjNVGlzWDDB/ZXfuR/jCq7Hxjoe9ew=; b=idXxOLINXolO5ehPCefNgpauHL8b6Y2gypavh/g1gUi6fowuA0aKE0CDLJwDNPnB14 1Iw3rHnoBwB86yQRw7JUEkNe0JufGaeGFYNLLbyu+WmfBpHb/HbPAiMeP4hRtK29xfdU RsfmV6kHzEHhIJyeqgBJjGTIxERfN8pvJnoOqwTOz5fH83aCBpxDbFZ+kwjNwqmNp178 xznB8zCK+yLz/V6a8qxaqfFV2mrkHhA4ubLkTVWX1UPxLhKFLQsfqYqh/pdCTif5Gdx5 pL1IHAEEszCpuUHrWZFgCMMBs2nyEMHAbbfkgUjr92tlOW4WxzO4ySOx1+N8gfNcuWZl 9SuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786548045; x=1787152845; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=craqyBqdnDvM4zjNVGlzWDDB/ZXfuR/jCq7Hxjoe9ew=; b=fFWt8aMTqf0Dzbp8/62rcrBdPeC5SMj688f3IoJHrHaVq36YEkIJZLynFPk870UR7S YSAmX3SL5qiyL1CQIB2jrcK8An1rkrRJRrx3k1zAyI7AMgoxE5rjSjgA9rJQR6HIDlAk cDHskmWkpkjizkDQzq5rUXv1xitvBT2/xbfc+3cJwbRtjvX+wdpZKXPfL5fUeaM5YoJj 2dimOgwo+TPLM+hdVGADT8ymezaIMJxi3mFcZvxcisZGJeQXR5q6MRLKT+KvZNAwSs+N RLP1DpmBawmxeHlaiyDy6mlNNhLtPfMenh1vRzbomPLi/kvIpNNff8q/JPY2ze4WNY1y smTg== X-Forwarded-Encrypted: i=1; AHgh+Roiw6PsSbGxNQPrPJ4greISkfOEETCInLTAH7gaU5bne/fYrPeFZnpy8smLAqKiP97endhTkbqqsHT6CEc=@vger.kernel.org X-Gm-Message-State: AOJu0Yymd8wdLF7QxgwGtNa13FJwllnbzuUuAUYt6l1T6/QA6OrtCG6s SC2bLP5XEpFZPRk2vOwViFfjscc2U7aHnacfl6peNC7OFaOwzJdFWSGj X-Gm-Gg: AR+sD11lwHuA/Rb4WRfWYZghlSiN807BOpCjFutrKF/CZfAtq2tizFXOdB+D4cSzSNy 2oYJGVRY5m+/quF+t15pFcD/G8+bf7W4/wy+Rp3r2H8ipDdNZmNIGgUyocSygBvJBCslfjWOTQm ju19MDRDRwB/1chmHNyORRBnWExXZhzNd0gE7uPeUFCiBwgQzR58RvgvpPoXa2JdHojeGZkQR/q ATgimvt1szaqFgz/1jZhs8AJvIl8sGnxTV1CQcxcgIPfC1yn8ULF9OHWvzx+KpurxhormE50cRA /rVttCnIobRSM9OewYNdnu5cjH3i/Iv+rSWb6s5WiV+ET4wrqRWTR8a5iJ4bb9XWnNFLTCgIPrr Y78PuAC/m3Q2nAyXyJpJz6NO1vyeY/Y65Q9vo9oKkkeQRgzw0cxwdNARGCscs6YUFhybcdO3mRI jB89hiARP+aqtqhWOIhIss3x8O19vbcRrcprCP3ygxdgicHSPZFxAehLPz0mYxM4TbQEN7TnTvK 9BIrdjISR4OpGypaF0TGXC02huGGD3Qko/6 X-Received: by 2002:a17:90b:2b8f:b0:38e:8300:af51 with SMTP id 98e67ed59e1d1-39301424de5mr6935116a91.8.1786548044416; Wed, 12 Aug 2026 08:20:44 -0700 (PDT) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com ([106.51.165.140]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141243819eesm10653360c88.0.2026.08.12.08.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 08:20:43 -0700 (PDT) From: "Mukesh Kumar Chaurasiya (IBM)" To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, sshegde@linux.ibm.com, mchauras@linux.ibm.com, mkchauras@gmail.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Venkat Rao Bagalkote Subject: [PATCH] powerpc/entry: Use hard_irq_disable() in arch_interrupt_exit_prepare() Date: Wed, 12 Aug 2026 20:50:35 +0530 Message-ID: <20260812152035.1661781-1-mkchauras@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- 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) -- 2.55.0