Commit 04a9ee48 authored by Du Yilong's avatar Du Yilong Committed by Zheng Zengkai
Browse files

sw64: kvm: remap pages of guest by vm_insert_page()

Sunway inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I56WV8



--------------------------------

It used to clear VM_IO and VM_PFNMAP of the vma flag, then
set again before release this vma to get the physical pages
corresponding to the user virtual address.

But __get_user_pages() will fail because of bad pte without
VM_PFNMAP if HAVE_GENERIC_GUP and ARCH_HAS_PTE_SPECIAL are
enabled.

To fix this issue, remap pages by vm_insert_page() to insert
individual pages allocated for guest.

Signed-off-by: default avatarDu Yilong <duyilong@wxiat.com>

Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent b782c474
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment