mm/vmalloc: fix vmalloc_to_page for huge vmap mappings
ascend inclusion category: feature bugzilla: NA CVE: NA https://lwn.net/ml/linux-kernel/20200825145753.529284-2-npiggin@gmail.com/ -------------- 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 029c54b0 ("mm/vmalloc.c: huge-vmap: fail gracefully on unexpected huge vmap mappings") Signed-off-by: NNicholas Piggin <npiggin@gmail.com> Signed-off-by: NRui Xiang <rui.xiang@huawei.com> Reviewed-by: NDing Tianhong <dingtianhong@huawei.com> Reviewed-by: NZefan Li <lizefan@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录