From 484adee53ec00db0e107067f4f87727b9b7bf177 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Tue, 1 Dec 2020 16:35:30 +0100 Subject: [PATCH] cpu/x86/smm/smm_stub: Fix stack canary on x86_64 On x86_64 the cannary is 8 bytes in size, so write the additional 4 bytes to make SMM handler happy. Tested on Intel Skylake in long mode. No longer dies in SMM. Change-Id: Id805c65717ec22f413803c21928d070602522b2c Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/48215 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/cpu/x86/smm/smm_stub.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cpu/x86/smm/smm_stub.S b/src/cpu/x86/smm/smm_stub.S index 56e2504892..45f634d0c9 100644 --- a/src/cpu/x86/smm/smm_stub.S +++ b/src/cpu/x86/smm/smm_stub.S @@ -144,6 +144,9 @@ smm_trampoline32: movl stack_size, %eax subl %eax, %ebx /* %ebx(stack_top) - size = %ebx(stack_bottom) */ movl %ebx, (%ebx) +#if ENV_X86_64 + movl $0, 4(%ebx) +#endif /* Create stack frame by pushing a NULL stack base pointer */ pushl $0x0