]> Git Repo - linux.git/commitdiff
x86/mm: convert pte_next_pfn() to pte_advance_pfn()
authorRyan Roberts <[email protected]>
Thu, 15 Feb 2024 10:31:52 +0000 (10:31 +0000)
committerAndrew Morton <[email protected]>
Thu, 22 Feb 2024 23:27:18 +0000 (15:27 -0800)
Core-mm needs to be able to advance the pfn by an arbitrary amount, so
override the new pte_advance_pfn() API to do so.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ryan Roberts <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Cc: Alistair Popple <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Barry Song <[email protected]>
Cc: Borislav Petkov (AMD) <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James Morse <[email protected]>
Cc: John Hubbard <[email protected]>
Cc: Kefeng Wang <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: Zi Yan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
arch/x86/include/asm/pgtable.h

index b50b2ef63672f4469c540f1c92c6481b2685bd8a..69ed0ea0641bd072c677692a67c93ce6f968fb42 100644 (file)
@@ -955,13 +955,13 @@ static inline int pte_same(pte_t a, pte_t b)
        return a.pte == b.pte;
 }
 
-static inline pte_t pte_next_pfn(pte_t pte)
+static inline pte_t pte_advance_pfn(pte_t pte, unsigned long nr)
 {
        if (__pte_needs_invert(pte_val(pte)))
-               return __pte(pte_val(pte) - (1UL << PFN_PTE_SHIFT));
-       return __pte(pte_val(pte) + (1UL << PFN_PTE_SHIFT));
+               return __pte(pte_val(pte) - (nr << PFN_PTE_SHIFT));
+       return __pte(pte_val(pte) + (nr << PFN_PTE_SHIFT));
 }
-#define pte_next_pfn   pte_next_pfn
+#define pte_advance_pfn        pte_advance_pfn
 
 static inline int pte_present(pte_t a)
 {
This page took 0.061741 seconds and 4 git commands to generate.