linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail.com>
Subject: [RFC PATCH 4/5] powerpc/64s/radix: implement complete radix__ptep_get_and_clear_full
Date: Sun, 20 Dec 2020 09:48:12 +1000	[thread overview]
Message-ID: <20201219234813.830747-5-npiggin@gmail.com> (raw)
In-Reply-To: <20201219234813.830747-1-npiggin@gmail.com>

Currently the radix variant is only called when full=true. Allow
radix to take over the entire function.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/include/asm/book3s/64/pgtable.h | 10 +++-------
 arch/powerpc/include/asm/book3s/64/radix.h   |  4 ++++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 058601efbc8a..410a917c0c60 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -483,14 +483,10 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm,
 					    unsigned long addr,
 					    pte_t *ptep, int full)
 {
-	if (full && radix_enabled()) {
-		/*
-		 * We know that this is a full mm pte clear and
-		 * hence can be sure there is no parallel set_pte.
-		 */
+	if (radix_enabled())
 		return radix__ptep_get_and_clear_full(mm, addr, ptep, full);
-	}
-	return ptep_get_and_clear(mm, addr, ptep);
+	else
+		return ptep_get_and_clear(mm, addr, ptep);
 }
 
 
diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h
index c7813dc628fc..2491f3befda0 100644
--- a/arch/powerpc/include/asm/book3s/64/radix.h
+++ b/arch/powerpc/include/asm/book3s/64/radix.h
@@ -185,6 +185,10 @@ static inline pte_t radix__ptep_get_and_clear_full(struct mm_struct *mm,
 	unsigned long old_pte;
 
 	if (full) {
+		/*
+		 * We know that this is a full mm pte clear and
+		 * hence can be sure there is no parallel set_pte.
+		 */
 		old_pte = pte_val(*ptep);
 		*ptep = __pte(0);
 	} else
-- 
2.23.0


  parent reply	other threads:[~2020-12-19 23:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-19 23:48 [RFC PATCH 0/5] powerpc/64s/radix: Use non-atomic ops for PTE Nicholas Piggin
2020-12-19 23:48 ` [RFC PATCH 1/5] powerpc/64s: update_mmu_cache inline the radix test Nicholas Piggin
2020-12-20 11:37   ` Christophe Leroy
2020-12-22  3:32     ` Nicholas Piggin
2020-12-19 23:48 ` [RFC PATCH 2/5] powerpc/64s: implement mm_nmmu_has_tlbs Nicholas Piggin
2020-12-19 23:48 ` [RFC PATCH 3/5] powerpc/64s: add CONFIG_PPC_NMMU for nest MMU support Nicholas Piggin
2020-12-20 11:43   ` Christophe Leroy
2020-12-22  3:37     ` Nicholas Piggin
2020-12-19 23:48 ` Nicholas Piggin [this message]
2020-12-19 23:48 ` [RFC PATCH 5/5] powerpc/64s/radix: Use non-atomic PTE updates if the MMU does not modify the PTE Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201219234813.830747-5-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).