Skip to contentSkip to conversation

riscv-convert-alloc_pmd-pte_late-to-use-ptdescs.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 21, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: riscv: convert alloc_{pmd, pte}_late() to use ptdescs
has been removed from the -mm tree. Its filename was
riscv-convert-alloc_pmd-pte_late-to-use-ptdescs.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: "Vishal Moola (Oracle)" <[email protected]>
Subject: riscv: convert alloc_{pmd, pte}_late() to use ptdescs
Date: Mon, 7 Aug 2023 16:05:08 -0700

As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs.

Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize page tables further.

Cc Arnd Bergmann <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Claudio Imbrenda <[email protected]>
Cc Dave Hansen <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Guo Ren <[email protected]>
Cc Huacai Chen <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc John Paul Adrian Glaubitz <[email protected]>
Cc Jonas Bonn <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Thomas Bogendoerfer <[email protected]>
Cc Yoshinori Sato <[email protected]>

---

 arch/riscv/include/asm/pgalloc.h |    8 ++++----
 arch/riscv/mm/init.c             |   16 ++++++----------
 2 files changed, 10 insertions(+), 14 deletions(-)
arch/riscv/include/asm/pgalloc.h renamed from arch/riscv/include/asm/pgalloc.h~riscv-convert-alloc_pmd-pte_late-to-use-ptdescs +4 -4
@@ -153,10 +153,10 @@ static inline pgd_t *pgd_alloc(struct mm
 
 #endif /* __PAGETABLE_PMD_FOLDED */
 
-#define __pte_free_tlb(tlb, pte, buf)   \
-do {                                    \
-	pgtable_pte_page_dtor(pte);     \
-	tlb_remove_page((tlb), pte);    \
+#define __pte_free_tlb(tlb, pte, buf)			\
+do {							\
+	pagetable_pte_dtor(page_ptdesc(pte));		\
+	tlb_remove_page_ptdesc((tlb), page_ptdesc(pte));\
 } while (0)
 #endif /* CONFIG_MMU */
 
arch/riscv/mm/init.c renamed from arch/riscv/mm/init.c~riscv-convert-alloc_pmd-pte_late-to-use-ptdescs +6 -10
@@ -353,12 +353,10 @@ static inline phys_addr_t __init alloc_p
 
 static phys_addr_t __init alloc_pte_late(uintptr_t va)
 {
-	unsigned long vaddr;
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	vaddr = __get_free_page(GFP_KERNEL);
-	BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page((void *)vaddr)));
-
-	return __pa(vaddr);
+	BUG_ON(!ptdesc || !pagetable_pte_ctor(ptdesc));
+	return __pa((pte_t *)ptdesc_address(ptdesc));
 }
 
 static void __init create_pte_mapping(pte_t *ptep,
@@ -436,12 +434,10 @@ static phys_addr_t __init alloc_pmd_fixm
 
 static phys_addr_t __init alloc_pmd_late(uintptr_t va)
 {
-	unsigned long vaddr;
-
-	vaddr = __get_free_page(GFP_KERNEL);
-	BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page((void *)vaddr)));
+	struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL & ~__GFP_HIGHMEM, 0);
 
-	return __pa(vaddr);
+	BUG_ON(!ptdesc || !pagetable_pmd_ctor(ptdesc));
+	return __pa((pmd_t *)ptdesc_address(ptdesc));
 }
 
 static void __init create_pmd_mapping(pmd_t *pmdp,

_

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