From f04465f3434617644ab2ddf68baec61e3803734a Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 8 Oct 2008 16:12:32 +0000 Subject: [PATCH] Fix v3 GeodeLX stack and global variable pointer corruption. We had a jump instead of a call to stage1_main in geodelx/stage0.S. That means all accesses to bist and init_detected were off by 8 bytes and collided with accesses to the global variable pointer. Found during my cleanup runs. This bug had the following effects: 1.) If gcc had decided to reload bist from stack after initializing the global variable pointer, bist would have been nonzero, an indicator for processor failure. 2.) If gcc had decided to use the stack location of bist as a scratch register (and it probably is free to do so as long as the contents are restored before returning), it would have clobbered the global variable pointer, leading to NULL pointer dereferences. 3.) Any accesses to init_detected would have resulted in accessing 4 bytes above the top of stack (0x87ffc-0x87fff), something the rest of the code deliberately avoids. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/coreboot-v3@909 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- arch/x86/geodelx/stage0.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/geodelx/stage0.S b/arch/x86/geodelx/stage0.S index 95b8e6a425..c3c1d7318f 100644 --- a/arch/x86/geodelx/stage0.S +++ b/arch/x86/geodelx/stage0.S @@ -271,7 +271,7 @@ lout: pushl $0 /* First parameter: bist */ pushl %eax - jmp stage1_main + call stage1_main /* We will not go back. */ #include "../stage0_common.S"