hv: add memory allocation functions for trampoline code relocation

emalloc_for_low_mem() is used if CONFIG_EFI_STUB is defined.
e820_alloc_low_memory() is used for other cases

In either case, the allocated memory will be marked with E820_TYPE_RESERVED

Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
This commit is contained in:
Zide Chen
2018-05-02 23:21:07 -07:00
committed by lijinxia
parent 1f074a2f2a
commit 77580edff0
4 changed files with 114 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ struct e820_mem_params {
};
int prepare_vm0_memmap_and_e820(struct vm *vm);
uint64_t e820_alloc_low_memory(uint32_t size);
/* Definition for a mem map lookup */
struct vm_lu_mem_map {