From 437ed88588d61a5b08ea8d6005b60e6ddd4eea2c Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Wed, 20 Jun 2018 14:16:06 +0800 Subject: [PATCH] hv: uos needn't to ummap trap mmio memory We wouldn't map this memory region for UOS. Signed-off-by: Li, Fei1 Acked-by: Eddie Dong --- hypervisor/arch/x86/ept.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hypervisor/arch/x86/ept.c b/hypervisor/arch/x86/ept.c index 1d0a6c890..b87f98551 100644 --- a/hypervisor/arch/x86/ept.c +++ b/hypervisor/arch/x86/ept.c @@ -234,7 +234,14 @@ int register_mmio_emulation_handler(struct vm *vm, mmio_node->range_start = start; mmio_node->range_end = end; - ept_mmap(vm, start, start, end - start, + + /* + * 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_vm0(vm)) + ept_mmap(vm, start, start, end - start, MAP_UNMAP, 0); /* Return success */