Skip to content

Commit

Permalink
powerpc/64s/radix: make ptep_get_and_clear_full non-atomic for the fu…
Browse files Browse the repository at this point in the history
…ll case

This matches other architectures, when we know there will be no
further accesses to the address (e.g., for teardown), page table
entries can be cleared non-atomically.

The comments about NMMU are bogus: all MMU notifiers (including NMMU)
are released at this point, with their TLBs flushed. An NMMU access at
this point would be a bug.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Jun 3, 2018
1 parent 6d8278c commit f569bd9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions arch/powerpc/include/asm/book3s/64/radix.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,8 @@ static inline pte_t radix__ptep_get_and_clear_full(struct mm_struct *mm,
unsigned long old_pte;

if (full) {
/*
* If we are trying to clear the pte, we can skip
* the DD1 pte update sequence and batch the tlb flush. The
* tlb flush batching is done by mmu gather code. We
* still keep the cmp_xchg update to make sure we get
* correct R/C bit which might be updated via Nest MMU.
*/
old_pte = __radix_pte_update(ptep, ~0ul, 0);
old_pte = pte_val(*ptep);
*ptep = __pte(0);
} else
old_pte = radix__pte_update(mm, addr, ptep, ~0ul, 0, 0);

Expand Down

0 comments on commit f569bd9

Please sign in to comment.