mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-08 04:09:11 +00:00
EFI: Allocate 2M aligned memory for hypervisor image
Hypervisor does memory alignment during initializing paging(init_paging) although the starting address allocated by EFI stub doesn't meet the requirement. As a result, HV might overwrite some memory belong to UEFI BIOS. The patch introduces a new routine to fix the issue. Tracked-On: #2349 Signed-off-by: Chaohong guo <chaohong.guo@intel.com> Reviewed-by: Zheng, Gen <gen.zheng@intel.com> Reviewed-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
@@ -363,7 +363,7 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *_table)
|
||||
* instead.
|
||||
*/
|
||||
#ifdef CONFIG_RELOC
|
||||
err = emalloc_reserved_mem(&hv_hpa, HV_RUNTIME_MEM_SIZE, MEM_ADDR_4GB);
|
||||
err = emalloc_reserved_aligned(&hv_hpa, HV_RUNTIME_MEM_SIZE, 1 << 21, MEM_ADDR_4GB);
|
||||
#else
|
||||
err = emalloc_fixed_addr(&hv_hpa, HV_RUNTIME_MEM_SIZE, CONFIG_HV_RAM_START);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user