From 4c53eb72d539f5ca61f949235014f7e43f0e6354 Mon Sep 17 00:00:00 2001 From: "Yarlagadda, Satya P" Date: Tue, 26 Jul 2016 09:14:17 +0800 Subject: IntelFsp2Pkg: Skip loading Microcode if MicrocodeCodeSize is zero During asm to Nasm conversion, we missed the code to skip loading the microcode and return success if the size is zero. Added additional check to report error if the microcode size is not zero but less than 2 kB. Cc: Giri P Mudusuru Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Satya Yarlagadda Reviewed-by: Giri P Mudusuru Reviewed-by: Jiewen Yao --- IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'IntelFsp2Pkg') diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm index 55ee85a06e..6e860238fd 100644 --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm @@ -172,7 +172,15 @@ ASM_PFX(LoadMicrocodeDefault): cmp eax, 0 jz ParamError mov esp, eax - + + ; skip loading Microcode if the MicrocodeCodeSize is zero + ; and report error if size is less than 2k + mov eax, dword [esp + LoadMicrocodeParams.MicrocodeCodeSize] + cmp eax, 0 + jz Exit2 + cmp eax, 0800h + jl ParamError + mov esi, dword [esp + LoadMicrocodeParams.MicrocodeCodeAddr] cmp esi, 0 jnz CheckMainHeader -- cgit v1.2.3