mm: remove "prot" parameter from move_pte()
authorDavid Hildenbrand <david@redhat.com>
Wed, 27 Mar 2024 14:33:01 +0000 (15:33 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:24 +0000 (20:56 -0700)
The "prot" parameter is unused, and using it instead of what's stored in
that particular PTE would very likely be wrong.  Let's simply remove it.

Link: https://lkml.kernel.org/r/20240327143301.741807-1-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/sparc/include/asm/pgtable_64.h
include/linux/pgtable.h
mm/mremap.c

index 26efc9bb644aa2455b24973aef84878eb6b4a576..3fe429d73a65b04cd82a3f140ac4b1dd11369089 100644 (file)
@@ -957,7 +957,7 @@ static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
 
 #ifdef DCACHE_ALIASING_POSSIBLE
 #define __HAVE_ARCH_MOVE_PTE
-#define move_pte(pte, prot, old_addr, new_addr)                                \
+#define move_pte(pte, old_addr, new_addr)                              \
 ({                                                                     \
        pte_t newpte = (pte);                                           \
        if (tlb_type != hypervisor && pte_present(pte)) {               \
index f108c7a3c1d9e71a1a5c777c59b2c5e3e2c20660..a3fc8150b047d2056d1d568797cb7d0e39c80867 100644 (file)
@@ -1079,7 +1079,7 @@ static inline void arch_swap_restore(swp_entry_t entry, struct folio *folio)
 #endif
 
 #ifndef __HAVE_ARCH_MOVE_PTE
-#define move_pte(pte, prot, old_addr, new_addr)        (pte)
+#define move_pte(pte, old_addr, new_addr)      (pte)
 #endif
 
 #ifndef pte_accessible
index 38d98465f3d825955cc81e515b24c77c4ff4552d..f5aba752d35f7600c505314e11ec1afaa2a05755 100644 (file)
@@ -205,7 +205,7 @@ static int move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
                 */
                if (pte_present(pte))
                        force_flush = true;
-               pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr);
+               pte = move_pte(pte, old_addr, new_addr);
                pte = move_soft_dirty_pte(pte);
                set_pte_at(mm, new_addr, new_pte, pte);
        }