mirror of
https://gitlab.com/qemu-project/edk2.git
synced 2025-10-30 07:56:39 +08:00
After bootloader calls FSP API mode, I found the RDI register is changed in some cases. Below is the first line of function FspApiCallingCheck in assembly dump mov qword ptr [rsp+0x8],rbx We can see compiler will use rsp+0x8 for some purpose, while rsp+0x8 is used to save RDI by FSP in code before. According to the x86-64 calling convention, caller is responsible for allocating 32 bytes of "shadow space" on the stack right before calling the function (regardless of the actual number of parameters used). However FSP code doesn't reserve 32 bytes before calling FspApiCallingCheck C function in 64bit. The patch fixes it by reserving the 32 bytes before calling C routine. Also, make sure the stack is 16-byte alignment, sub 0x28 to RSP. Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
IntelFsp2Pkg
This package provides the component to create an FSP binary.
Source Repository: https://github.com/tianocore/edk2/tree/master/IntelFsp2Pkg
A whitepaper to describe the IntelFsp2Pkg: https://firmware.intel.com/sites/default/files/A_Tour_Beyond_BIOS_Creating_the_Intel_Firmware_Support_Package_with_the_EFI_Developer_Kit_II_%28FSP2.0%29.pdf