summaryrefslogtreecommitdiff
path: root/src/cpu/x86
diff options
context:
space:
mode:
authorMarshall Dawson <marshalldawson3rd@gmail.com>2017-09-29 11:14:44 -0600
committerAaron Durbin <adurbin@chromium.org>2017-10-02 16:15:42 +0000
commitdf3190413354b9c7453e759f5579934474f0ab97 (patch)
treed1f311ca4e130a11d0a38cbd2a0b5ad96d31f9df /src/cpu/x86
parent38f19400f944524b77094ebe651bed0c7d56d4b6 (diff)
downloadcoreboot-df3190413354b9c7453e759f5579934474f0ab97.tar.xz
cpu/x86: Align stack in SIPI handler
Ensure the stack is properly aligned in the SIPI handler. This avoids an exception when an aligned instruction is performed on stack data. BUG=b:66003093 TEST=boot kahlee built with gcc 6.3 Change-Id: Ibdd8242494c6a2bc0c6ead7ac98be55149219d7c Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-on: https://review.coreboot.org/21768 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/cpu/x86')
-rw-r--r--src/cpu/x86/sipi_vector.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cpu/x86/sipi_vector.S b/src/cpu/x86/sipi_vector.S
index b40ea76f76..bd60c65a88 100644
--- a/src/cpu/x86/sipi_vector.S
+++ b/src/cpu/x86/sipi_vector.S
@@ -114,6 +114,8 @@ _start:
movl stack_top, %edx
subl %eax, %edx
mov %edx, %esp
+ andl $0xfffffff0, %esp /* ensure stack alignment */
+
/* Save CPU number. */
mov %ecx, %esi
@@ -192,7 +194,8 @@ load_msr:
mov %eax, %cr4
#endif
- /* c_handler(cpu_num) */
+ /* c_handler(cpu_num), preserve proper stack alignment */
+ sub $12, %esp
push %esi /* cpu_num */
mov c_handler, %eax
call *%eax