Skip to content

Commit b9ef323

Browse files
npigginmpe
authored andcommitted
powerpc/64s: Disable preemption in hash lazy mmu mode
apply_to_page_range on kernel pages does not disable preemption, which is a requirement for hash's lazy mmu mode, which keeps track of the TLBs to flush with a per-cpu array. Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Nicholas Piggin <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b12eb27 commit b9ef323

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/powerpc/include/asm/book3s/64/tlbflush-hash.h

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ static inline void arch_enter_lazy_mmu_mode(void)
3232

3333
if (radix_enabled())
3434
return;
35+
/*
36+
* apply_to_page_range can call us this preempt enabled when
37+
* operating on kernel page tables.
38+
*/
39+
preempt_disable();
3540
batch = this_cpu_ptr(&ppc64_tlb_batch);
3641
batch->active = 1;
3742
}
@@ -47,6 +52,7 @@ static inline void arch_leave_lazy_mmu_mode(void)
4752
if (batch->index)
4853
__flush_tlb_pending(batch);
4954
batch->active = 0;
55+
preempt_enable();
5056
}
5157

5258
#define arch_flush_lazy_mmu_mode() do {} while (0)

0 commit comments

Comments
 (0)