From 5e15fff58a7db65ee143877117ab0ac842a0e66e Mon Sep 17 00:00:00 2001 From: liwenxiang1 Date: Wed, 9 Oct 2024 16:46:19 +0800 Subject: [PATCH] arch/x68_64: properly align ap boot stack for vector operations Signed-off-by: liwenxiang1 --- arch/x86_64/src/intel64/intel64_head.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86_64/src/intel64/intel64_head.S b/arch/x86_64/src/intel64/intel64_head.S index 488f487fa6..355974e8e9 100644 --- a/arch/x86_64/src/intel64/intel64_head.S +++ b/arch/x86_64/src/intel64/intel64_head.S @@ -398,6 +398,13 @@ ap_start: /* Jump to ap_start routine */ movabs $x86_64_ap_boot, %rbx + + /* We need to simulate the behavior of the call instruction, which by + * default pushes 8 bytes of the RIP. Otherwise, the function's stack + * won't be 16-byte aligned. + */ + + pushq $0 jmp *%rbx #endif