提交 034e5afa 编写于 作者: A Alex Williamson 提交者: akpm

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: 1c563432 ("mm: fix is_pinnable_page against a cma page")
Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
Acked-by: NMinchan Kim <minchan@kernel.org>
Acked-by: NDavid Hildenbrand <david@redhat.com>
Reported-by: NYishai Hadas <yishaih@nvidia.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: John Dias <joaodias@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 327b18b7
...@@ -1600,7 +1600,7 @@ static inline bool is_pinnable_page(struct page *page) ...@@ -1600,7 +1600,7 @@ static inline bool is_pinnable_page(struct page *page)
if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE) if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE)
return false; return false;
#endif #endif
return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page))); return !is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page));
} }
#else #else
static inline bool is_pinnable_page(struct page *page) static inline bool is_pinnable_page(struct page *page)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册