[coreboot] [PATCH] v3: fix stack underflow for i586 and GeodeLX

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Aug 28 03:54:55 CEST 2008


stage1_main() calling conventions changed to use two parameters instead
of one. This resulted in a stack underflow for i586 and GeodeLX because
the stack was set up for only one parameter in their stage0 asm code.

Untested. Note that this didn't trigger on K8 because the stack setup
there has excessive room, something that should be fixed as well.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Index: corebootv3-stage1_init_detected/arch/x86/geodelx/stage0.S
===================================================================
--- corebootv3-stage1_init_detected/arch/x86/geodelx/stage0.S	(Revision 832)
+++ corebootv3-stage1_init_detected/arch/x86/geodelx/stage0.S	(Arbeitskopie)
@@ -365,6 +365,9 @@
 	movl    $0, %eax
 	pushl   %eax
 
+	/* Store zero for the unused init_detected parameter. */
+	pushl   %eax
+
 	/* Restore the BIST result. */
 	movl	%ebp, %eax
 
Index: corebootv3-stage1_init_detected/arch/x86/stage0_i586.S
===================================================================
--- corebootv3-stage1_init_detected/arch/x86/stage0_i586.S	(Revision 832)
+++ corebootv3-stage1_init_detected/arch/x86/stage0_i586.S	(Arbeitskopie)
@@ -439,6 +439,9 @@
 	movl    $0, %eax
 	pushl   %eax
 
+	/* Store zero for the unused init_detected parameter. */
+	pushl   %eax
+
 	/* Restore the BIST result */
 	movl	%ebp, %eax
 	/* We need to set ebp ? No need */


-- 
http://www.hailfinger.org/

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: linuxbios3_stage1_init_detected.diff
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080828/f11ba155/attachment.ksh>


More information about the coreboot mailing list