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: #2349
Signed-off-by: Chaohong guo <chaohong.guo@intel.com>
Reviewed-By: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
Chaohong guo 2019-01-21 15:42:13 +08:00 committed by Eddie Dong
parent 41dd38baf2
commit 8f22a6e89a

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);
}