x86/mm: switch to new APIs in arch_init_memory
authorWei Liu <wei.liu2@citrix.com>
Thu, 5 Mar 2020 09:42:18 +0000 (10:42 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 5 Mar 2020 09:42:18 +0000 (10:42 +0100)
commit109ecb894525e16cf84f34ead15467980fa2edfd
tree0dcb529df8c3ff3ff3e624feee7205f361315c1a
parente5f88ef94a6928883562f6b0f4a4271f398f9cbc
x86/mm: switch to new APIs in arch_init_memory

The function will map and unmap pages on demand.

Since we now map and unmap Xen PTE pages, we would like to track the
lifetime of mappings so that 1) we do not dereference memory through a
variable after it is unmapped, 2) we do not unmap more than once.
Therefore, we introduce the UNMAP_DOMAIN_PAGE macro to nullify the
variable after unmapping, and ignore NULL.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c
xen/include/xen/domain_page.h