Skip to contentSkip to conversation

arch-remove-mk_pmd.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 12, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: arch: remove mk_pmd()
has been removed from the -mm tree. Its filename was
arch-remove-mk_pmd.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Matthew Wilcox (Oracle)" <[email protected]>
Subject: arch: remove mk_pmd()
Date: Wed, 2 Apr 2025 19:17:05 +0100

There are now no callers of mk_huge_pmd() and mk_pmd(). Remove them.

Cc Zi Yan <[email protected]>
Cc Alexander Gordeev <[email protected]>
Cc Andreas Larsson <[email protected]>
Cc Anton Ivanov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Muchun Song <[email protected]>
Cc Richard Weinberger <[email protected]>

---

 arch/arc/include/asm/hugepage.h              |    2 --
 arch/arc/include/asm/pgtable-levels.h        |    1 -
 arch/arm/include/asm/pgtable-3level.h        |    1 -
 arch/arm64/include/asm/pgtable.h             |    1 -
 arch/loongarch/include/asm/pgtable.h         |    1 -
 arch/loongarch/mm/pgtable.c                  |    9 ---------
 arch/mips/include/asm/pgtable.h              |    3 ---
 arch/mips/mm/pgtable-32.c                    |   10 ----------
 arch/mips/mm/pgtable-64.c                    |    9 ---------
 arch/powerpc/include/asm/book3s/64/pgtable.h |    1 -
 arch/powerpc/mm/book3s64/pgtable.c           |    5 -----
 arch/riscv/include/asm/pgtable-64.h          |    2 --
 arch/s390/include/asm/pgtable.h              |    1 -
 arch/sparc/include/asm/pgtable_64.h          |    1 -
 arch/x86/include/asm/pgtable.h               |    2 --
 include/linux/huge_mm.h                      |    2 --
 16 files changed, 51 deletions(-)
arch/arc/include/asm/hugepage.h renamed from arch/arc/include/asm/hugepage.h~arch-remove-mk_pmd +0 -2
@@ -40,8 +40,6 @@ static inline pmd_t pte_pmd(pte_t pte)
 #define pmd_young(pmd)		pte_young(pmd_pte(pmd))
 #define pmd_dirty(pmd)		pte_dirty(pmd_pte(pmd))
 
-#define mk_pmd(page, prot)	pte_pmd(mk_pte(page, prot))
-
 #define pmd_trans_huge(pmd)	(pmd_val(pmd) & _PAGE_HW_SZ)
 
 #define pfn_pmd(pfn, prot)	(__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
arch/arc/include/asm/pgtable-levels.h renamed from arch/arc/include/asm/pgtable-levels.h~arch-remove-mk_pmd +0 -1
@@ -142,7 +142,6 @@
 
 #define pmd_pfn(pmd)		((pmd_val(pmd) & PMD_MASK) >> PAGE_SHIFT)
 #define pfn_pmd(pfn,prot)	__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
-#define mk_pmd(page,prot)	pfn_pmd(page_to_pfn(page),prot)
 
 #endif
 
arch/arm64/include/asm/pgtable.h renamed from arch/arm64/include/asm/pgtable.h~arch-remove-mk_pmd +0 -1
@@ -609,7 +609,6 @@ static inline pmd_t pmd_mkspecial(pmd_t
 #define __phys_to_pmd_val(phys)	__phys_to_pte_val(phys)
 #define pmd_pfn(pmd)		((__pmd_to_phys(pmd) & PMD_MASK) >> PAGE_SHIFT)
 #define pfn_pmd(pfn,prot)	__pmd(__phys_to_pmd_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
-#define mk_pmd(page,prot)	pfn_pmd(page_to_pfn(page),prot)
 
 #define pud_young(pud)		pte_young(pud_pte(pud))
 #define pud_mkyoung(pud)	pte_pud(pte_mkyoung(pud_pte(pud)))
arch/arm/include/asm/pgtable-3level.h renamed from arch/arm/include/asm/pgtable-3level.h~arch-remove-mk_pmd +0 -1
@@ -209,7 +209,6 @@ PMD_BIT_FUNC(mkyoung,   |= PMD_SECT_AF);
 
 #define pmd_pfn(pmd)		(((pmd_val(pmd) & PMD_MASK) & PHYS_MASK) >> PAGE_SHIFT)
 #define pfn_pmd(pfn,prot)	(__pmd(((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot)))
-#define mk_pmd(page,prot)	pfn_pmd(page_to_pfn(page),prot)
 
 /* No hardware dirty/accessed bits -- generic_pmdp_establish() fits */
 #define pmdp_establish generic_pmdp_establish
arch/loongarch/include/asm/pgtable.h renamed from arch/loongarch/include/asm/pgtable.h~arch-remove-mk_pmd +0 -1
@@ -255,7 +255,6 @@ static inline void pmd_clear(pmd_t *pmdp
 
 #define pmd_page_vaddr(pmd)	pmd_val(pmd)
 
-extern pmd_t mk_pmd(struct page *page, pgprot_t prot);
 extern void set_pmd_at(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp, pmd_t pmd);
 
 #define pte_page(x)		pfn_to_page(pte_pfn(x))
arch/loongarch/mm/pgtable.c renamed from arch/loongarch/mm/pgtable.c~arch-remove-mk_pmd +0 -9
@@ -135,15 +135,6 @@ void kernel_pte_init(void *addr)
 	} while (p != end);
 }
 
-pmd_t mk_pmd(struct page *page, pgprot_t prot)
-{
-	pmd_t pmd;
-
-	pmd_val(pmd) = (page_to_pfn(page) << PFN_PTE_SHIFT) | pgprot_val(prot);
-
-	return pmd;
-}
-
 void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 		pmd_t *pmdp, pmd_t pmd)
 {
arch/mips/include/asm/pgtable.h renamed from arch/mips/include/asm/pgtable.h~arch-remove-mk_pmd +0 -3
@@ -713,9 +713,6 @@ static inline pmd_t pmd_clear_soft_dirty
 
 #endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */
 
-/* Extern to avoid header file madness */
-extern pmd_t mk_pmd(struct page *page, pgprot_t prot);
-
 static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
 {
 	pmd_val(pmd) = (pmd_val(pmd) & (_PAGE_CHG_MASK | _PAGE_HUGE)) |
arch/mips/mm/pgtable-32.c renamed from arch/mips/mm/pgtable-32.c~arch-remove-mk_pmd +0 -10
@@ -31,16 +31,6 @@ void pgd_init(void *addr)
 }
 
 #if defined(CONFIG_TRANSPARENT_HUGEPAGE)
-pmd_t mk_pmd(struct page *page, pgprot_t prot)
-{
-	pmd_t pmd;
-
-	pmd_val(pmd) = (page_to_pfn(page) << PFN_PTE_SHIFT) | pgprot_val(prot);
-
-	return pmd;
-}
-
-
 void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 		pmd_t *pmdp, pmd_t pmd)
 {
arch/mips/mm/pgtable-64.c renamed from arch/mips/mm/pgtable-64.c~arch-remove-mk_pmd +0 -9
@@ -90,15 +90,6 @@ void pud_init(void *addr)
 #endif
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-pmd_t mk_pmd(struct page *page, pgprot_t prot)
-{
-	pmd_t pmd;
-
-	pmd_val(pmd) = (page_to_pfn(page) << PFN_PTE_SHIFT) | pgprot_val(prot);
-
-	return pmd;
-}
-
 void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 		pmd_t *pmdp, pmd_t pmd)
 {
arch/powerpc/include/asm/book3s/64/pgtable.h renamed from arch/powerpc/include/asm/book3s/64/pgtable.h~arch-remove-mk_pmd +0 -1
@@ -1096,7 +1096,6 @@ static inline bool pmd_access_permitted(
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 extern pmd_t pfn_pmd(unsigned long pfn, pgprot_t pgprot);
 extern pud_t pfn_pud(unsigned long pfn, pgprot_t pgprot);
-extern pmd_t mk_pmd(struct page *page, pgprot_t pgprot);
 extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
 extern pud_t pud_modify(pud_t pud, pgprot_t newprot);
 extern void set_pmd_at(struct mm_struct *mm, unsigned long addr,
arch/powerpc/mm/book3s64/pgtable.c renamed from arch/powerpc/mm/book3s64/pgtable.c~arch-remove-mk_pmd +0 -5
@@ -269,11 +269,6 @@ pud_t pfn_pud(unsigned long pfn, pgprot_
 	return __pud_mkhuge(pud_set_protbits(__pud(pudv), pgprot));
 }
 
-pmd_t mk_pmd(struct page *page, pgprot_t pgprot)
-{
-	return pfn_pmd(page_to_pfn(page), pgprot);
-}
-
 pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
 {
 	unsigned long pmdv;
arch/riscv/include/asm/pgtable-64.h renamed from arch/riscv/include/asm/pgtable-64.h~arch-remove-mk_pmd +0 -2
@@ -262,8 +262,6 @@ static inline unsigned long _pmd_pfn(pmd
 	return __page_val_to_pfn(pmd_val(pmd));
 }
 
-#define mk_pmd(page, prot)    pfn_pmd(page_to_pfn(page), prot)
-
 #define pmd_ERROR(e) \
 	pr_err("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
 
arch/s390/include/asm/pgtable.h renamed from arch/s390/include/asm/pgtable.h~arch-remove-mk_pmd +0 -1
@@ -1869,7 +1869,6 @@ static inline pmd_t pmdp_collapse_flush(
 #define pmdp_collapse_flush pmdp_collapse_flush
 
 #define pfn_pmd(pfn, pgprot)	mk_pmd_phys(((pfn) << PAGE_SHIFT), (pgprot))
-#define mk_pmd(page, pgprot)	pfn_pmd(page_to_pfn(page), (pgprot))
 
 static inline int pmd_trans_huge(pmd_t pmd)
 {
arch/sparc/include/asm/pgtable_64.h renamed from arch/sparc/include/asm/pgtable_64.h~arch-remove-mk_pmd +0 -1
@@ -233,7 +233,6 @@ static inline pmd_t pfn_pmd(unsigned lon
 
 	return __pmd(pte_val(pte));
 }
-#define mk_pmd(page, pgprot)	pfn_pmd(page_to_pfn(page), (pgprot))
 #endif
 
 /* This one can be done with two shifts.  */
arch/x86/include/asm/pgtable.h renamed from arch/x86/include/asm/pgtable.h~arch-remove-mk_pmd +0 -2
@@ -1347,8 +1347,6 @@ static inline void ptep_set_wrprotect(st
 
 #define flush_tlb_fix_spurious_fault(vma, address, ptep) do { } while (0)
 
-#define mk_pmd(page, pgprot)   pfn_pmd(page_to_pfn(page), (pgprot))
-
 #define  __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS
 extern int pmdp_set_access_flags(struct vm_area_struct *vma,
 				 unsigned long address, pmd_t *pmdp,
include/linux/huge_mm.h renamed from include/linux/huge_mm.h~arch-remove-mk_pmd +0 -2
@@ -495,8 +495,6 @@ static inline bool is_huge_zero_pmd(pmd_
 struct folio *mm_get_huge_zero_folio(struct mm_struct *mm);
 void mm_put_huge_zero_folio(struct mm_struct *mm);
 
-#define mk_huge_pmd(page, prot) pmd_mkhuge(mk_pmd(page, prot))
-
 static inline bool thp_migration_supported(void)
 {
 	return IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION);

_

Patches currently in -mm which might be from [email protected] are