vlapic: unmap vlapic base only for SOS

as SOS mapped all memory at the beginning, so trap vlapic need unmap its
memory; for UOS, there is no need as UOS never mapped it.

Tracked-On: #1124
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Jason Chen CJ 2018-09-08 03:33:09 +08:00 committed by lijinxia
parent 457ac7408d
commit 8773dfb1f6

View File

@ -1970,6 +1970,8 @@ int vlapic_create(struct vcpu *vcpu)
if (is_vcpu_bsp(vcpu)) {
uint64_t *pml4_page =
(uint64_t *)vcpu->vm->arch_vm.nworld_eptp;
/* only need unmap it from SOS as UOS never mapped it */
if (is_vm0(vcpu->vm))
ept_mr_del(vcpu->vm, pml4_page,
DEFAULT_APIC_BASE, CPU_PAGE_SIZE);