[coreboot-gerrit] Change in coreboot[master]: cpu/x86: Align stack in SIPI handler

Marshall Dawson (Code Review) gerrit at coreboot.org
Fri Sep 29 19:20:21 CEST 2017


Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/21768


Change subject: cpu/x86: Align stack in SIPI handler
......................................................................

cpu/x86: Align stack in SIPI handler

Ensure the stack is properly aligned in the SIPI handler.

BUG=b:66003093
TEST=boot kahlee built with gcc 6.3

Change-Id: Ibdd8242494c6a2bc0c6ead7ac98be55149219d7c
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/cpu/x86/sipi_vector.S
1 file changed, 4 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/21768/1

diff --git a/src/cpu/x86/sipi_vector.S b/src/cpu/x86/sipi_vector.S
index b40ea76..bd60c65 100644
--- a/src/cpu/x86/sipi_vector.S
+++ b/src/cpu/x86/sipi_vector.S
@@ -114,6 +114,8 @@
 	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 @@
 	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

-- 
To view, visit https://review.coreboot.org/21768
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibdd8242494c6a2bc0c6ead7ac98be55149219d7c
Gerrit-Change-Number: 21768
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170929/0645f225/attachment.html>


More information about the coreboot-gerrit mailing list