[coreboot-gerrit] Change in coreboot[master]: arch/x86/assembly_entry: align stack for car_stage_entry

Marshall Dawson (Code Review) gerrit at coreboot.org
Tue Jul 11 02:42:23 CEST 2017


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


Change subject: arch/x86/assembly_entry: align stack for car_stage_entry
......................................................................

arch/x86/assembly_entry: align stack for car_stage_entry

At process _start, the stack is expected to be aligned to a
16-byte boundary.  Upon entry to any function the stack frame
must have the end of any arguments also aligned.  In other words
the value of %esp+4 or %rsp+8 is always a multiple of 16 (1).

Change the method for executing car_stage_entry from jmp to call.
This should keep the stack aligned regardless of a 32- or 64-bit
build.

Although 4-byte alignment is the minimum requirement for i386,
some AMD platforms use SSE instructions which expect 16-byte.

1) http://wiki.osdev.org/System_V_ABI
   See "Initial Stack and Register State" and "The Stack Frame"
   in the supplements.

Change-Id: I8a15514f551a8e17e9fe77b8402fe0d2b106972e
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/arch/x86/assembly_entry.S
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/20528/1

diff --git a/src/arch/x86/assembly_entry.S b/src/arch/x86/assembly_entry.S
index 56a5b63..465c02f 100644
--- a/src/arch/x86/assembly_entry.S
+++ b/src/arch/x86/assembly_entry.S
@@ -63,7 +63,7 @@
 	jz	debug_spinloop
 #endif
 
-	jmp	car_stage_entry
+	call	car_stage_entry
 
 /* This is here for linking purposes. */
 .weak car_stage_entry

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a15514f551a8e17e9fe77b8402fe0d2b106972e
Gerrit-Change-Number: 20528
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/20170711/e45d4e9b/attachment.html>


More information about the coreboot-gerrit mailing list