x86: don't clear bss in ramstage entry

The cbfs stage loading routine already zeros out the full
memory region that a stage will be loaded. Therefore, it is
unnecessary to to clear the bss again after once ramstage starts.

Change-Id: Icc7021329dbf59bef948a41606f56746f21b507f
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/2865
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Aaron Durbin 2013-03-20 13:49:27 -05:00 committed by Ronald G. Minnich
parent 1cc4737c3b
commit eb06a4259b
2 changed files with 1 additions and 11 deletions

View File

@ -29,17 +29,6 @@ _start:
cld cld
/** clear bss, which unlike the stack is zero by definition */
leal _bss, %edi
movl $_ebss, %ecx
subl %edi, %ecx
jz .Lnobss
shrl $2, %ecx /* it is 32 bit aligned, right? */
xorl %eax, %eax
rep
stosl
.Lnobss:
/** poison the stack. Code should not count on the /** poison the stack. Code should not count on the
* stack being full of zeros. This stack poisoning * stack being full of zeros. This stack poisoning
* recently uncovered a bug in the broadcast SIPI * recently uncovered a bug in the broadcast SIPI

View File

@ -129,6 +129,7 @@ void * cbfs_load_stage(struct cbfs_media *media, const char *name)
name, name,
(uint32_t) stage->load, stage->memlen, (uint32_t) stage->load, stage->memlen,
stage->entry); stage->entry);
/* Stages rely the below clearing so that the bss is initialized. */
memset((void *) (uint32_t) stage->load, 0, stage->memlen); memset((void *) (uint32_t) stage->load, 0, stage->memlen);
if (cbfs_decompress(stage->compression, if (cbfs_decompress(stage->compression,