lkml.org 
[lkml]   [2024]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RESEND v2 2/9] riscv: Safely remove huge_pte_offset() when manipulating NAPOT ptes
Date
The pte_t pointer is expected to point to the first entry of the NAPOT
mapping so no need to use huge_pte_offset(), similarly to what is done
in arm64.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
arch/riscv/mm/hugetlbpage.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c
index fe8067ee71b4..f042f5c8bdb7 100644
--- a/arch/riscv/mm/hugetlbpage.c
+++ b/arch/riscv/mm/hugetlbpage.c
@@ -274,7 +274,6 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
return ptep_set_access_flags(vma, addr, ptep, pte, dirty);

pte_num = arch_contpte_get_num_contig(ptep, 0, &pgsize);
- ptep = huge_pte_offset(mm, addr, pte_num * pgsize);

orig_pte = get_clear_contig_flush(mm, addr, ptep, pte_num);

@@ -319,10 +318,8 @@ void huge_ptep_set_wrprotect(struct mm_struct *mm,
}

pte_num = arch_contpte_get_num_contig(ptep, 0, &pgsize);
- ptep = huge_pte_offset(mm, addr, pte_num * pgsize);

orig_pte = get_clear_contig_flush(mm, addr, ptep, pte_num);
-
orig_pte = pte_wrprotect(orig_pte);

set_ptes(mm, addr, ptep, orig_pte, pte_num);
--
2.39.2

\
 
 \ /
  Last update: 2024-05-08 13:36    [W:0.149 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site