From 6f310d1ab20a04ddaa86b6e038906f40ba2365b2 Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Wed, 30 Oct 2019 18:43:33 +0800 Subject: [PATCH] hv: mmio: move EPT operation out of register_mmio_emulation_handler register_mmio_emulation_handler should only register handler for mmio emulation. Tracked-On: #3475 Signed-off-by: Li, Fei1 --- hypervisor/dm/io_req.c | 11 ----------- hypervisor/dm/vioapic.c | 3 +++ 2 files changed, 3 insertions(+), 11 deletions(-) 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; }