Skip to content

Commit

Permalink
powerpc/64s: Disable preemption in hash lazy mmu mode
Browse files Browse the repository at this point in the history
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 <linux@roeck-us.net>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221013151647.1857994-1-npiggin@gmail.com
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Oct 18, 2022
1 parent b12eb27 commit b9ef323
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ static inline void arch_enter_lazy_mmu_mode(void)

if (radix_enabled())
return;
/*
* apply_to_page_range can call us this preempt enabled when
* operating on kernel page tables.
*/
preempt_disable();
batch = this_cpu_ptr(&ppc64_tlb_batch);
batch->active = 1;
}
Expand All @@ -47,6 +52,7 @@ static inline void arch_leave_lazy_mmu_mode(void)
if (batch->index)
__flush_tlb_pending(batch);
batch->active = 0;
preempt_enable();
}

#define arch_flush_lazy_mmu_mode() do {} while (0)
Expand Down

0 comments on commit b9ef323

Please sign in to comment.