Skip to content

Commit

Permalink
mm/vmalloc.c: support HIGHMEM pages in vmap_pages_range_noflush()
Browse files Browse the repository at this point in the history
If the pages being mapped are in HIGHMEM, page_address() returns NULL. 
This probably wasn't noticed before because there aren't currently any
architectures with HAVE_ARCH_HUGE_VMALLOC and HIGHMEM, but it's simpler to
call page_to_phys() and futureproofs us against such configurations
existing.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 121e6f3 ("mm/vmalloc: hugepage vmalloc mappings")
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: William Kucharski <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Cc: Uladzislau Rezki <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Matthew Wilcox authored and akpm00 committed Sep 12, 2022
1 parent b8dd3ee commit 08262ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
int err;

err = vmap_range_noflush(addr, addr + (1UL << page_shift),
__pa(page_address(pages[i])), prot,
page_to_phys(pages[i]), prot,
page_shift);
if (err)
return err;
Expand Down

0 comments on commit 08262ac

Please sign in to comment.