summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Ecc
diff options
context:
space:
mode:
authorZhiguang Liu <zhiguang.liu@intel.com>2025-09-17 12:39:00 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-09-23 06:54:45 +0300
commit18d053d6828ca308824bd64ddea04de789d97edb (patch)
tree9833e68376067747369c5d546f25945b443d8e19 /BaseTools/Source/Python/Ecc
parentfb43f0c085045771bc2dee2f867d87298de2facb (diff)
downloadedk2-18d053d6828ca308824bd64ddea04de789d97edb.tar.xz
IntelFsp2Pkg/FspSecCore: Reserve 32B when calling C function in 64bit
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>
Diffstat (limited to 'BaseTools/Source/Python/Ecc')
0 files changed, 0 insertions, 0 deletions