Skip to content

Commit 034e5af

Browse files
awilliamakpm00
authored andcommitted
mm: re-allow pinning of zero pfns
The commit referenced below subtly and inadvertently changed the logic to disallow pinning of zero pfns. This breaks device assignment with vfio and potentially various other users of gup. Exclude the zero page test from the negation. Link: https://lkml.kernel.org/r/165490039431.944052.12458624139225785964.stgit@omen Fixes: 1c56343 ("mm: fix is_pinnable_page against a cma page") Signed-off-by: Alex Williamson <[email protected]> Acked-by: Minchan Kim <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reported-by: Yishai Hadas <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: John Hubbard <[email protected]> Cc: John Dias <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Zhangfei Gao <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Joao Martins <[email protected]> Cc: Yi Liu <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 327b18b commit 034e5af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/mm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ static inline bool is_pinnable_page(struct page *page)
16001600
if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE)
16011601
return false;
16021602
#endif
1603-
return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page)));
1603+
return !is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page));
16041604
}
16051605
#else
16061606
static inline bool is_pinnable_page(struct page *page)

0 commit comments

Comments
 (0)