acrn-hypervisor/hypervisor/include/arch/x86
Zide Chen ceb3076b69 HV: added memory allocation functions for AP trampoline code relocation
V2->V3: Fixed the booting issue on MRB board and removed the restriction
        of allocate memory from address 0

1) Fix the booting from MRB issue
-#define    CONFIG_LOW_RAM_SIZE 0x000CF000
+#define    CONFIG_LOW_RAM_SIZE 0x00010000

2) changed e820_alloc_low_memory() to handle corner case of unaligned e820 entries
  and enable it to allocate memory at address 0
+		a length = end > start ? (end - start) : 0;

-       /* We don't want the first page */
-       if ((length == size) && (start == 0))
-           continue;

3) changed emalloc_for_low_mem() to enable to allocate memory at address 0
-       /* We don't want the first page */
-       if (start == 0)
-           start = EFI_PAGE_SIZE;

V1->V2: moved e820_alloc_low_memory() to guest.c and added the logic to
        handle unaligned E820 entries

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>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
2018-05-15 17:25:58 +08:00
..
guest HV: added memory allocation functions for AP trampoline code relocation 2018-05-15 17:25:58 +08:00
apicreg.h Fix compiler warnings when building for UEFI 2018-05-15 17:19:38 +08:00
assign.h ptdev: change remapping entry from virtual to physical based 2018-05-15 17:25:57 +08:00
cpu.h HV Cx: load cx data to boot_cpu_data when boot 2018-05-15 17:25:57 +08:00
cpufeatures.h hv: add hardware_detect_support to detect which hardware we support 2018-05-15 17:25:56 +08:00
cpuid.h HV: add cpu model name 2018-05-15 17:25:25 +08:00
gdt.h initial import 2018-05-11 14:44:28 +08:00
hv_arch.h HV: code cleanup for cpu state 2018-05-15 17:25:56 +08:00
idt.h initial import 2018-05-11 14:44:28 +08:00
intr_ctx.h initial import 2018-05-11 14:44:28 +08:00
io.h HV Cx: allow guest to access host idle port 2018-05-15 17:25:57 +08:00
ioapic.h ptdev: change remapping entry from virtual to physical based 2018-05-15 17:25:57 +08:00
irq.h rename vmexit handlers 2018-05-15 17:25:55 +08:00
lapic.h refine: remove redundant data type definition 2018-05-15 17:25:54 +08:00
mmu.h hv: add hardware_detect_support to detect which hardware we support 2018-05-15 17:25:56 +08:00
msr.h hv: vmx_capability: add cpu_has_vmx_ept/vpid_cap API 2018-05-15 17:25:55 +08:00
multiboot.h UEFI: change the efi_ctx passing method 2018-05-15 17:19:39 +08:00
softirq.h initial import 2018-05-11 14:44:28 +08:00
timer.h HV: Fix the missing list_head initializaiton 2018-05-15 17:25:58 +08:00
trusty.h mmu:create temporary page tables for guest at run time 2018-05-15 17:25:26 +08:00
vmexit.h rename vmexit handlers 2018-05-15 17:25:55 +08:00
vmx.h check validity of 'VM-exit Int-Info' before extracting vector 2018-05-15 17:25:55 +08:00
vtd.h ept: change eptp to PA 2018-05-15 17:25:25 +08:00
zeropage.h vm load: fix bug in loading kernel 2018-05-15 17:19:37 +08:00