Skip to content

Commit f569bd9

Browse files
npigginmpe
authored andcommitted
powerpc/64s/radix: make ptep_get_and_clear_full non-atomic for the full 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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 6d8278c commit f569bd9

File tree

1 file changed

+2
-8
lines changed
  • arch/powerpc/include/asm/book3s/64

1 file changed

+2
-8
lines changed

arch/powerpc/include/asm/book3s/64/radix.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,8 @@ static inline pte_t radix__ptep_get_and_clear_full(struct mm_struct *mm,
180180
unsigned long old_pte;
181181

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

0 commit comments

Comments
 (0)