[PATCH v5 1/3] PPC32: Fix hard_irq_disable to follow tracing and lockdep state

From: Shrikanth Hegde

Date: Wed Nov 18 2026 - 00:15:04 EST


On PPC32, the code for hard_irq_disable has diverged and it doesn't
do lockdep/tracing anymore, leading to use of both local_irq_disable
and hard_irq_disable on PPC32 to overcome those.

That is un-necessary, instead simply calling local_irq_disable is
enough. It disables EE bit and does lockdep tracking.

Subsequent patch uses this API in KVM code to avoid the warnings.
Wider use of it is possible, but it will be taken subsequently.

Cc: <stable@xxxxxxxxxxxxxxx> # v7.2+
Suggested-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
Signed-off-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>
---
PS: New warnings would have started since commit
12013e3d4695 ("KVM: powerpc: Use generic xfer to guest work function")
which added local_irq_disable for 32 bit. The proper fix may date back
years ago. To avoid backport complications, keeping it backported till
7.2. So removed fixes tag and cc'ed stable.

Also, 32 bit shouldn't need hard_irq_disable. But that can only be taken
up subsequently.

Also, below fix isn't needed anymore.
https://lore.kernel.org/linuxppc-dev/a14571be1897955f43d9994f0e093de3ada6ecde.1793447880.git.ritesh.list@xxxxxxxxx/

arch/powerpc/include/asm/hw_irq.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index b7eee6385ae5..ddb850e62abd 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -464,7 +464,7 @@ static inline bool arch_irqs_disabled(void)
return arch_irqs_disabled_flags(arch_local_save_flags());
}

-#define hard_irq_disable() arch_local_irq_disable()
+#define hard_irq_disable() local_irq_disable()

static inline bool regs_irqs_disabled(struct pt_regs *regs)
{
--
2.54.0