From 3d93cd78d8a20ebd7628434e233eedb83b93c54e Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Fri, 3 Dec 2021 17:17:45 +0100 Subject: [PATCH] src/arch/x86/exit_car: Add proper x86_64 code Don't truncate upper bits in assembly code and thus allow loading of postcar stage above 4GiB. Tested on qemu with cbmem_top set to TOUUD. Change-Id: I42d1086f1220e44076ccf613244fc3c6d804805b Signed-off-by: Patrick Rudolph Signed-off-by: Benjamin Doron Reviewed-on: https://review.coreboot.org/c/coreboot/+/79162 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/arch/x86/exit_car.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/arch/x86/exit_car.S b/src/arch/x86/exit_car.S index c9ff866b1a..d435dbe25b 100644 --- a/src/arch/x86/exit_car.S +++ b/src/arch/x86/exit_car.S @@ -67,8 +67,14 @@ skip_clflush: invd movl $_estack, %esp +#if ENV_X86_64 + /* Align stack to 16 bytes at call instruction. */ + movq $0xfffffffffffffff0, %rax + and %rax, %rsp +#else /* Align stack to 16 bytes at call instruction. */ andl $0xfffffff0, %esp +#endif /* Call this in assembly as some platforms like to mess with the bootflow and call into main directly from chipset_teardown_car. */ -- 2.11.4.GIT