diff --git a/hypervisor/dm/io_req.c b/hypervisor/dm/io_req.c index c83a40163..b75435d10 100644 --- a/hypervisor/dm/io_req.c +++ b/hypervisor/dm/io_req.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #define ACRN_DBG_IOREQUEST 6U @@ -695,16 +694,6 @@ void register_mmio_emulation_handler(struct acrn_vm *vm, mmio_node->handler_private_data = handler_private_data; mmio_node->range_start = start; mmio_node->range_end = end; - - /* - * SOS would map all its memory at beginning, so we - * should unmap it. But UOS will not, so we shouldn't - * need to unmap it. - */ - if (is_sos_vm(vm)) { - ept_del_mr(vm, (uint64_t *)vm->arch_vm.nworld_eptp, start, end - start); - } - } } diff --git a/hypervisor/dm/vioapic.c b/hypervisor/dm/vioapic.c index 5cc8694c7..009d13a13 100644 --- a/hypervisor/dm/vioapic.c +++ b/hypervisor/dm/vioapic.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -472,6 +473,8 @@ vioapic_init(struct acrn_vm *vm) (uint64_t)VIOAPIC_BASE, (uint64_t)VIOAPIC_BASE + VIOAPIC_SIZE, vm); + ept_del_mr(vm, (uint64_t *)vm->arch_vm.nworld_eptp, + (uint64_t)VIOAPIC_BASE, (uint64_t)VIOAPIC_SIZE); vm->arch_vm.vioapic.ready = true; }