HV: adjust the starting addr of HV to be 2M-aligned

In init_paging(), when modify page table, it does a round up to 2M on
the starting address of HV memory. If the address is not 2M aligned,
memory overwrite occurs, or memory attribute(cache, u/s) may be not
right. Besides, trusty memory (uos_sworld_memory) in .bss section is 2M
aligned during compiling,  after enabling HV memroy 2M alignment, when
relocation is enabled, EFI stub or other loaders just needs to find a
2M-aligned starting addr for HV memory.

Tracked-On: #2349
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
Reviewed-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
Chaohong guo 2019-01-16 14:30:02 +08:00 committed by Eddie Dong
parent 07f14401ec
commit 9feab4cf29
1 changed files with 4 additions and 2 deletions

View File

@ -249,9 +249,9 @@ config LOW_RAM_SIZE
0x10000, starting from address 0x0.
config HV_RAM_START
hex "Start physical address of the RAM region used by the hypervisor"
hex "2M-aligned Start physical address of the RAM region used by the hypervisor"
default 0x6e000000 if PLATFORM_SBL
default 0x00100000 if PLATFORM_UEFI
default 0x00400000 if PLATFORM_UEFI
help
A 64-bit integer indicating the base physical address where the
hypervisor should be loaded. If RELOC is disabled, the bootloader
@ -260,6 +260,8 @@ config HV_RAM_START
hypervisor may relocate its symbols to where it is placed,
and thus the bootloader might not place the hypervisor at this
specific address.
Note that the addr demands 2M aligned, otherwise memory corruption
may occur.
config HV_RAM_SIZE
hex "Size of the RAM region used by the hypervisor"