linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] arch/powerpc/hugetlb: Use pte_access_permitted for hugetlb access check
@ 2017-12-04  2:19 Aneesh Kumar K.V
  2017-12-04  2:19 ` [PATCH 2/3] powerpc/mm/book3s/64: Add proper pte access check helper Aneesh Kumar K.V
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Aneesh Kumar K.V @ 2017-12-04  2:19 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: linuxppc-dev, Aneesh Kumar K.V

No functional change in this patch. This update gup_hugepte to use the
helper. This will help later when we add memory keys.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/mm/hugetlbpage.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index a9b9083c5e49..c7e5afe5e118 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -855,9 +855,7 @@ int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
 
 	pte = READ_ONCE(*ptep);
 
-	if (!pte_present(pte) || !pte_read(pte))
-		return 0;
-	if (write && !pte_write(pte))
+	if (!pte_access_permitted(pte, write))
 		return 0;
 
 	/* hugepages are never "special" */
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-20  6:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-04  2:19 [PATCH 1/3] arch/powerpc/hugetlb: Use pte_access_permitted for hugetlb access check Aneesh Kumar K.V
2017-12-04  2:19 ` [PATCH 2/3] powerpc/mm/book3s/64: Add proper pte access check helper Aneesh Kumar K.V
2017-12-04  2:19 ` [PATCH 3/3] powerpc/mm/ " Aneesh Kumar K.V
2018-08-17 15:12   ` Christophe LEROY
2018-08-20  6:12     ` Christophe LEROY
2018-01-17 13:30 ` [1/3] arch/powerpc/hugetlb: Use pte_access_permitted for hugetlb access check Michael Ellerman
2018-08-20  6:12 ` [PATCH 1/3] " Christophe LEROY

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).