[coreboot-gerrit] Patch set updated for coreboot: emulation/i440fx: set %esp to 0xa0000 so very large ramstages will work.

Ronald G. Minnich (rminnich@gmail.com) gerrit at coreboot.org
Thu Jun 16 05:59:43 CEST 2016


Ronald G. Minnich (rminnich at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15201

-gerrit

commit 1a20fc656960cd0c27b7edf09b9360fd4e82708f
Author: Ronald G. Minnich <rminnich at gmail.com>
Date:   Tue Jun 14 13:18:10 2016 -0700

    emulation/i440fx: set %esp to 0xa0000 so very large ramstages will work.
    
    cache_as_ram.inc for emulation/qemu-i440fx was setting the
    stack to CONFIG_RAMTOP for the copy_and_run stage.
    This value failed for very large ramstages because we
    overwrote the stack with the ramstage.
    
    In general, payloads won't use anything below 1M, and the romstage on
    this target already uses 0xdxxxx for the stack. 0xa0000 seems a good
    choice since should we pop too much qemu will exit quickly.
    
    I ran this by Gerd Hoffman and he feels it's a reasonable value.
    
    Change-Id: I065b39af9cd49f75221a2f436f445b2380d1806b
    Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>
---
 src/mainboard/emulation/qemu-i440fx/cache_as_ram.inc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mainboard/emulation/qemu-i440fx/cache_as_ram.inc b/src/mainboard/emulation/qemu-i440fx/cache_as_ram.inc
index fcd2d3b..675b6f0 100644
--- a/src/mainboard/emulation/qemu-i440fx/cache_as_ram.inc
+++ b/src/mainboard/emulation/qemu-i440fx/cache_as_ram.inc
@@ -58,7 +58,12 @@ __main:
 	post_code(POST_PREPARE_RAMSTAGE)
 	cld			/* Clear direction flag. */
 
-	movl	$CONFIG_RAMTOP, %esp
+	/* Set the (pre-decremented) %esp to a value that will
+	 * cause qemu to kill us if we ever pop too much. This
+	 * value also gets the copy_and_run stack out of the way
+	 * of big ramstages. The ramstage will load its own %esp
+	 * so there is no harm in using this value. */
+	movl	$0xa0000, %esp
 	movl	%esp, %ebp
 	call	copy_and_run
 



More information about the coreboot-gerrit mailing list