virt: acrn: obtain pa from VMA with PFNMAP flag
authorYonghua Huang <yonghua.huang@intel.com>
Mon, 28 Feb 2022 02:22:12 +0000 (05:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Mar 2022 12:49:56 +0000 (13:49 +0100)
commit8a6e85f75a83d16a71077e41f2720c691f432002
treec75b22c771477f48384fb59e9a8117b860746c9b
parentfbeac3dfc762871e72676a065ddd13e5087f26ab
virt: acrn: obtain pa from VMA with PFNMAP flag

 acrn_vm_ram_map can't pin the user pages with VM_PFNMAP flag
 by calling get_user_pages_fast(), the PA(physical pages)
 may be mapped by kernel driver and set PFNMAP flag.

 This patch fixes logic to setup EPT mapping for PFN mapped RAM region
 by checking the memory attribute before adding EPT mapping for them.

Fixes: 88f537d5e8dd ("virt: acrn: Introduce EPT mapping management")
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
Link: https://lore.kernel.org/r/20220228022212.419406-1-yonghua.huang@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/virt/acrn/mm.c