hv: mmu: add static paging table allocation for hypervisor

Add static paging table allocation API for hypervisor.
Note: must configure PLATFORM_RAM_SIZE and PLATFORM_MMIO_SIZE exactly as the platform.

Rename RAM_START/RAM_SIZE to HV_RAM_START/HV_RAM_SIZE for HV.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2018-10-29 23:28:32 +08:00
committed by lijinxia
parent 74a5eec3a7
commit dc9d18a868
12 changed files with 163 additions and 39 deletions

View File

@@ -356,7 +356,7 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *_table)
}
/* without relocateion enabled, hypervisor binary need to reside in
* fixed memory address starting from CONFIG_RAM_START, make a call
* fixed memory address starting from CONFIG_HV_RAM_START, make a call
* to emalloc_fixed_addr for that case. With CONFIG_RELOC enabled,
* hypervisor is able to do relocation, the only requirement is that
* it need to reside in memory below 4GB, call emalloc_reserved_mem()
@@ -365,7 +365,7 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *_table)
#ifdef CONFIG_RELOC
err = emalloc_reserved_mem(&hv_hpa, HV_RUNTIME_MEM_SIZE, MEM_ADDR_4GB);
#else
err = emalloc_fixed_addr(&hv_hpa, HV_RUNTIME_MEM_SIZE, CONFIG_RAM_START);
err = emalloc_fixed_addr(&hv_hpa, HV_RUNTIME_MEM_SIZE, CONFIG_HV_RAM_START);
#endif
if (err != EFI_SUCCESS)
goto failed;