path: root/arch/sparc
diff options
authorNicholas Piggin <>2021-04-29 22:58:13 -0700
committerLinus Torvalds <>2021-04-30 11:20:39 -0700
commitc0eb315ad9719e41ce44708455cc69df7ac9f3f8 (patch)
tree8de836d37d5e4d0d8c2f15c309b303cd56e325c1 /arch/sparc
parent972472c7466b50efed4539694007951a3fc7b95c (diff)
mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page
vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. Whether or not a vmap is huge depends on the architecture details, alignments, boot options, etc., which the caller can not be expected to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. This change teaches vmalloc_to_page about larger pages, and returns the struct page that corresponds to the offset within the large page. This makes the API agnostic to mapping implementation details. [*] As explained by commit 029c54b095995 ("mm/vmalloc.c: huge-vmap: fail gracefully on unexpected huge vmap mappings") [ sparc32: add stub pud_page define for walking huge vmalloc page tables] Link: Link: Signed-off-by: Nicholas Piggin <> Reviewed-by: Miaohe Lin <> Reviewed-by: Christoph Hellwig <> Cc: Borislav Petkov <> Cc: Catalin Marinas <> Cc: Ding Tianhong <> Cc: "H. Peter Anvin" <> Cc: Ingo Molnar <> Cc: Michael Ellerman <> Cc: Russell King <> Cc: Thomas Gleixner <> Cc: Uladzislau Rezki (Sony) <> Cc: Will Deacon <> Cc: Stephen Rothwell <> Cc: David S. Miller <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'arch/sparc')
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
index 632cdb959542..a5cf79c149fe 100644
--- a/arch/sparc/include/asm/pgtable_32.h
+++ b/arch/sparc/include/asm/pgtable_32.h
@@ -321,6 +321,9 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+/* only used by the huge vmap code, should never be called */
+#define pud_page(pud) NULL
struct seq_file;
void mmu_info(struct seq_file *m);