Skip to content

Commit 8773dfb

Browse files
JasonChenCJlijinxia
authored andcommitted
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>
1 parent 457ac74 commit 8773dfb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hypervisor/arch/x86/guest/vlapic.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,8 +1970,10 @@ int vlapic_create(struct vcpu *vcpu)
19701970
if (is_vcpu_bsp(vcpu)) {
19711971
uint64_t *pml4_page =
19721972
(uint64_t *)vcpu->vm->arch_vm.nworld_eptp;
1973-
ept_mr_del(vcpu->vm, pml4_page,
1974-
DEFAULT_APIC_BASE, CPU_PAGE_SIZE);
1973+
/* only need unmap it from SOS as UOS never mapped it */
1974+
if (is_vm0(vcpu->vm))
1975+
ept_mr_del(vcpu->vm, pml4_page,
1976+
DEFAULT_APIC_BASE, CPU_PAGE_SIZE);
19751977

19761978
ept_mr_add(vcpu->vm, pml4_page,
19771979
vlapic_apicv_get_apic_access_addr(vcpu->vm),

0 commit comments

Comments
 (0)