HV: fix per-cpu stack relocation in trampoline.c

In write_trampoline_stack_sym(), when do relocation for pcpu's stack,
it wrongly adds an offset. As a result, during booting, when non-BSP
CPU (APs) tries to run trampoline code once they are waken up by BSP
via SIPI, system hangs.

Tracked-On: #2035
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
This commit is contained in:
Chaohong guo 2019-01-21 15:42:13 +08:00 committed by wenlingz
parent 5b88e59ca4
commit 3bbe6b739c

View File

@ -45,7 +45,7 @@ void write_trampoline_stack_sym(uint16_t pcpu_id)
hva = (uint64_t *)(hpa2hva(trampoline_start16_paddr) + trampoline_relo_addr(secondary_cpu_stack));
stack_sym_addr = (uint64_t)&per_cpu(stack, pcpu_id)[CONFIG_STACK_SIZE - 1];
*hva = stack_sym_addr + get_hv_image_delta();
*hva = stack_sym_addr;
clflush(hva);
}