pmap: Implement pmap_ept_transform() for NVMM
authorAaron LI <aly@aaronly.me>
Sun, 6 Jun 2021 03:30:13 +0000 (11:30 +0800)
committerAaron LI <aly@aaronly.me>
Tue, 20 Jul 2021 23:28:22 +0000 (07:28 +0800)
commit297019886e36c44b41a02c510e06e635ce29f43e
treebcb6d8ee7e58da7b661814e9026261d4c00b4c2e
parentcc0c2bc29becb2f5643eb54d7307ffe0390d22ca
pmap: Implement pmap_ept_transform() for NVMM

The pmap_ept_transform() transforms an initialized pmap structure to be
EPT type for Intel VMX hypervisor (e.g., NVMM) use.  This implementation
is derived from vmx_ept_init() and vmx_ept_pmap_pinit() in
'pc64/vmm/ept.c'.

Note that this function has a different prototype as NetBSD's one,
because we don't make 'pmap_ept_has_ad' a global variable so we need to
pass extra flags to the pmap.

When zeroing out the page directories, note that the valid area is two
pages if there is a pm_pmlpv_iso PTE installed (i.e., the system has
meltdown mitigation enabled), otherwise, it's only one page.  (credit to
Matt Dillon)
sys/platform/pc64/x86_64/pmap.c
sys/vm/pmap.h