From 5958d6f65f4d149d6685d0f7b7f606ef17492577 Mon Sep 17 00:00:00 2001 From: Sainath Grandhi Date: Thu, 2 Apr 2020 12:03:48 -0700 Subject: [PATCH] hv: Fix issues with the patch to reserve EPT 4K pages after boot This patch fixes couple of minor issues with patch 8ffe6fc6 Tracked-On: #4563 Signed-off-by: Sainath Grandhi --- hypervisor/arch/x86/page.c | 3 +-- hypervisor/include/arch/x86/vm_config.h | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/page.c b/hypervisor/arch/x86/page.c index 907800a7c..4f170656c 100644 --- a/hypervisor/arch/x86/page.c +++ b/hypervisor/arch/x86/page.c @@ -12,7 +12,6 @@ #include #include #include -#include static struct page ppt_pml4_pages[PML4_PAGE_NUM(CONFIG_PLATFORM_RAM_SIZE + PLATFORM_LO_MMIO_SIZE)]; static struct page ppt_pdpt_pages[PDPT_PAGE_NUM(CONFIG_PLATFORM_RAM_SIZE + PLATFORM_LO_MMIO_SIZE)]; @@ -104,7 +103,7 @@ static union pgtable_pages_info ept_pages_info[CONFIG_MAX_VM_NUM]; static const uint64_t vm_address_space_size[MAX_LOAD_ORDER] = { PRE_VM_EPT_ADDRESS_SPACE(CONFIG_UOS_RAM_SIZE), /* for Pre-Launched VM */ EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE), /* for SOS VM */ - EPT_ADDRESS_SPACE(CONFIG_SOS_RAM_SIZE), /* for Post-Launched VM */ + EPT_ADDRESS_SPACE(CONFIG_UOS_RAM_SIZE), /* for Post-Launched VM */ }; /* diff --git a/hypervisor/include/arch/x86/vm_config.h b/hypervisor/include/arch/x86/vm_config.h index 49f2dbb43..49bac1ffa 100644 --- a/hypervisor/include/arch/x86/vm_config.h +++ b/hypervisor/include/arch/x86/vm_config.h @@ -36,6 +36,9 @@ * PRE_LAUNCHED_VM is launched by ACRN hypervisor, with LAPIC_PT; * SOS_VM is launched by ACRN hypervisor, without LAPIC_PT; * POST_LAUNCHED_VM is launched by ACRN devicemodel, with/without LAPIC_PT depends on usecases. + * + * Assumption: vm_configs array is completely initialized w.r.t. load_order member of + * acrn_vm_config for all the VMs. */ enum acrn_vm_load_order { PRE_LAUNCHED_VM = 0,