linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Support HIGHMEM pages in vmap_pages_range_noflush()
@ 2022-08-18 21:07 Matthew Wilcox
  2022-08-19 10:06 ` William Kucharski
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2022-08-18 21:07 UTC (permalink / raw)
  To: Andrew Morton, Uladzislau Rezki, linux-mm; +Cc: Nicholas Piggin

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.

Fixes: 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index dd6cdb201195..bea9b0c37295 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Support HIGHMEM pages in vmap_pages_range_noflush()
  2022-08-18 21:07 [PATCH] Support HIGHMEM pages in vmap_pages_range_noflush() Matthew Wilcox
@ 2022-08-19 10:06 ` William Kucharski
  0 siblings, 0 replies; 2+ messages in thread
From: William Kucharski @ 2022-08-19 10:06 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Andrew Morton, Uladzislau Rezki, linux-mm, Nicholas Piggin

Looks good and IMHO it's more self-documenting.

Reviewed-by: <william.kucharski@oracle.com>

> On Aug 18, 2022, at 3:07 PM, Matthew Wilcox <willy@infradead.org> wrote:
> 
> 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.
> 
> Fixes: 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings")
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index dd6cdb201195..bea9b0c37295 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -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;
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-19 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 21:07 [PATCH] Support HIGHMEM pages in vmap_pages_range_noflush() Matthew Wilcox
2022-08-19 10:06 ` William Kucharski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox