From 38fd6685e9da61daadc96a8d537e6966dfe3b219 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Sat, 21 Apr 2018 00:14:08 -0600 Subject: arch/x86: align stack on entry to x86_exception() Entry points from assembly to C need to have the stacks aligned to 16 bytes with the newer compilers. This entry point was missed. Correct it. BUG=b:72728953 Change-Id: Idb29daf830c05fd5543c2194690364ce31b6a22c Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/25763 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/arch/x86/idt.S | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/arch/x86/idt.S') diff --git a/src/arch/x86/idt.S b/src/arch/x86/idt.S index 1878f802ed..17ddb57fb7 100644 --- a/src/arch/x86/idt.S +++ b/src/arch/x86/idt.S @@ -172,9 +172,16 @@ int_hand: pushl %ecx pushl %eax - pushl %esp /* Pointer to structure on the stack */ + /* Save pointer to eregs structure */ + movl %esp, %ebp + /* Align stack to 16 bytes. */ + andl $0xfffffff0, %esp + /* Save original stack pointer while keeping stack alignment. This + value is also the eregs argument x86_exception(). */ + sub $12, %esp + pushl %ebp /* Pointer to structure on the stack */ call x86_exception - pop %eax /* Drop the pointer */ + pop %esp /* Unwind the stack alignment and argument passing. */ popl %eax popl %ecx -- cgit v1.2.3