smm: Push a null stack base pointer

When generating a backtrace we need an indicator when we have hit the
beginning of the stack. The i386 ABI states that %ebp points to the next
stack frame. NULL can be used to indicate the end of the stack.

We could add a NULL return pointer at %ebp+4, but I decided to omit it
since a NULL stack pointer can be used as an indicator that there is no
return pointer.

BUG=b:80539294
TEST=built and tested on grunt

Change-Id: I8a48114d31a5c716335d264fa4fe4da41dc5bf11
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-on: https://review.coreboot.org/27226
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Raul E Rangel 2018-06-25 14:22:27 -06:00 committed by Martin Roth
parent 0140541f50
commit 871156898c
1 changed files with 3 additions and 0 deletions

View File

@ -135,6 +135,9 @@ smm_trampoline32:
movl stack_top, %edx movl stack_top, %edx
subl %eax, %edx /* global_stack_top - offset = stack_top */ subl %eax, %edx /* global_stack_top - offset = stack_top */
mov %edx, %esp mov %edx, %esp
/* Create stack frame by pushing a NULL stack base pointer */
pushl $0x0
mov %esp, %ebp mov %esp, %ebp
/* Allocate locals (fxsave) */ /* Allocate locals (fxsave) */