Skip to content

Commit c233bf5

Browse files
JasonChenCJwenlingz
authored andcommitted
make sure secondary CPU's stack is aligned with CPU STACK
secondary CPU's stack should be aligned with 16 Tracked-On: #2410 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
1 parent ee066a7 commit c233bf5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

hypervisor/arch/x86/trampoline.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ void write_trampoline_stack_sym(uint16_t pcpu_id)
4545
hva = (uint64_t *)(hpa2hva(trampoline_start16_paddr) + trampoline_relo_addr(secondary_cpu_stack));
4646

4747
stack_sym_addr = (uint64_t)&per_cpu(stack, pcpu_id)[CONFIG_STACK_SIZE - 1];
48+
stack_sym_addr &= ~(CPU_STACK_ALIGN - 1UL);
4849
*hva = stack_sym_addr;
4950

5051
clflush(hva);

0 commit comments

Comments
 (0)