mm/vmalloc: fix vmalloc_to_page for huge vmap mappings
ascend inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4EUVI 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:Nicholas Piggin <npiggin@gmail.com> Signed-off-by:
Rui Xiang <rui.xiang@huawei.com> Reviewed-by:
Ding Tianhong <dingtianhong@huawei.com> Reviewed-by:
Zefan Li <lizefan@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Loading
Please sign in to comment