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:
Chaohong guo
2019-01-16 13:53:26 +08:00
committed by Eddie Dong
parent 912be6c4dd
commit ad0f8bc3b1
3 changed files with 73 additions and 1 deletions

View File

@@ -52,6 +52,9 @@
extern EFI_SYSTEM_TABLE *sys_table;
extern EFI_BOOT_SERVICES *boot;
extern EFI_STATUS
emalloc_reserved_aligned(EFI_PHYSICAL_ADDRESS *addr, UINTN size, UINTN align, EFI_PHYSICAL_ADDRESS maxaddr);
/**
* allocate_pages - Allocate memory pages from the system
* @atype: type of allocation to perform