[coreboot] r838 - in coreboot-v3/arch/x86: . geodelx

svn at coreboot.org svn at coreboot.org
Thu Aug 28 04:55:14 CEST 2008


Author: hailfinger
Date: 2008-08-28 04:55:14 +0200 (Thu, 28 Aug 2008)
New Revision: 838

Modified:
   coreboot-v3/arch/x86/geodelx/stage0.S
   coreboot-v3/arch/x86/stage0_i586.S
Log:
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.

This is a band-aid and we should do it right instead. Discussion
follows:

Carl-Daniel Hailfinger wrote:
> Can't we determine init_detected from C code and avoid working with it
> in asm?
> The Fam10h BKDG states in section 2.3.1:
> "determine the type of this reset. One method is to use [The Link
> Initialization Control Register] F0x6C[InitDet] bit."
> The same register is suggested by the Athlon64/Operon BKDG and the
> Fam0fh BKDG.
> 
> That should work from C and make our lives easier. To be honest, I
> have no idea why we use bit 11 of MTRRdefType_MSR for the
> init_detected purpose.

Ron Minnich wrote:
> I plan to change that in future. For now, I want to change as little
> as I can, since this code is so mysterious anyway. I would say let's
> leave it in with a warning of some sort.


Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Ronald G. Minnich <rminnich at gmail.com>


Modified: coreboot-v3/arch/x86/geodelx/stage0.S
===================================================================
--- coreboot-v3/arch/x86/geodelx/stage0.S	2008-08-28 02:37:29 UTC (rev 837)
+++ coreboot-v3/arch/x86/geodelx/stage0.S	2008-08-28 02:55:14 UTC (rev 838)
@@ -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
 

Modified: coreboot-v3/arch/x86/stage0_i586.S
===================================================================
--- coreboot-v3/arch/x86/stage0_i586.S	2008-08-28 02:37:29 UTC (rev 837)
+++ coreboot-v3/arch/x86/stage0_i586.S	2008-08-28 02:55:14 UTC (rev 838)
@@ -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 */





More information about the coreboot mailing list