Skip to content

Commit bc88ef6

Browse files
npigginmpe
authored andcommitted
powerpc/64s: Fix local irq disable when PMIs are disabled
When PMI interrupts are soft-masked, local_irq_save() will clear the PMI mask bit, allowing PMIs in and causing a race condition. This causes a deadlock in native_hpte_insert via hash_preload, which depends on PMIs being disabled since commit 8b91cee ("powerpc/64s/hash: Make hash faults work in NMI context"). native_hpte_insert calls local_irq_save(). It's possible the lpar hash code is also affected when tracing is enabled because __trace_hcall_entry() calls local_irq_save(). Fix this by making arch_local_irq_save() _or_ the IRQS_DISABLED bit into the mask. This was found with the stress_hpt option with a kbuild workload running together with `perf record -g`. Fixes: f442d00 ("powerpc/64s: Add support to mask perf interrupts and replay them") Fixes: 8b91cee ("powerpc/64s/hash: Make hash faults work in NMI context") Signed-off-by: Nicholas Piggin <[email protected]> [mpe: Just take the fix without the new warning] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fe6de81 commit bc88ef6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/include/asm/hw_irq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static inline void arch_local_irq_enable(void)
192192

193193
static inline unsigned long arch_local_irq_save(void)
194194
{
195-
return irq_soft_mask_set_return(IRQS_DISABLED);
195+
return irq_soft_mask_or_return(IRQS_DISABLED);
196196
}
197197

198198
static inline bool arch_irqs_disabled_flags(unsigned long flags)

0 commit comments

Comments
 (0)