Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct FspInfoheader Assumption #10678

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,12 @@ ASM_PFX(TempRamInitApi):
CALL_EBP ASM_PFX(LoadUpdPointerToECX) ; ECX for UPD param
SAVE_ECX ; save UPD param to slot 3 in xmm6

;
; Get FspInfoHeader address
;
CALL_EDI ASM_PFX(AsmGetFspInfoHeaderNoStack)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EAX holds FSP info header after LoadUpdPointerToECX called at line#602. We can save EAX to ESI at line#603 instead of calling AsmGetFspInfoHeaderNoStack here.

mov esi, eax

mov edx, ASM_PFX(PcdGet32 (PcdTemporaryRamSize))
mov edx, DWORD [edx]
;
Expand Down
7 changes: 7 additions & 0 deletions IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,13 @@ ASM_PFX(TempRamInitApi):
ParamValid:
SAVE_RCX

;
; Get FspInfoHeader address
;
CALL_RDI ASM_PFX(AsmGetFspInfoHeaderNoStack)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can call AsmGetFspInfoHeaderNoStack and save RAX to RSI at line#450. By doing so, calling AsmGetFspInfoHeaderNoStack can be removed from line#460.

mov rsi, rax
LOAD_RCX

mov rdx, ASM_PFX(PcdGet32 (PcdTemporaryRamSize))
mov edx, DWORD [rdx]
;
Expand Down
Loading