HV: Prepare cpu_secondary.S for AP trampoline code relocation

V1->V2: removed CONFIG_LOW_RAM_START and added ".org 0" to
cpu_secondary.S

The assumption is trampoline code is relocated while HV is not, so:

trampoline code is built at address 0, and CS register is updated
by SIPI to reflect the correct vector

in real mode part, added extra pointers for page tables and long jump buffer
so it's possible for HV code to patch the relocation offset

in long mode part, use absolute addressing when referring HV symbols,
and use relative addressing for symbols within trampoline code

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>
This commit is contained in:
Zide Chen
2018-05-02 23:09:19 -07:00
committed by Jack Ren
parent 8c06b69622
commit 9323f811ea
4 changed files with 25 additions and 16 deletions

View File

@@ -5,7 +5,7 @@ ENTRY(cpu_primary_start_32)
MEMORY
{
/* Low 1MB of memory for secondary processor start-up */
lowram : ORIGIN = CONFIG_LOW_RAM_START, LENGTH = CONFIG_LOW_RAM_SIZE
lowram : ORIGIN = 0, LENGTH = CONFIG_LOW_RAM_SIZE
/* 32 MBytes of RAM for HV */
ram : ORIGIN = CONFIG_RAM_START, LENGTH = CONFIG_RAM_SIZE
@@ -43,6 +43,7 @@ SECTIONS
.cpu_secondary : AT (_ld_cpu_secondary_reset_load)
{
/* entry point of AP wakeup, must be at the beginning of this section*/
_ld_cpu_secondary_reset_start = .;
*(.cpu_secondary_reset);
. = ALIGN(4);