summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Pei
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg PeiCore: Always use PeiImageRead() function to load PEI imageLiming Gao2018-09-281-84/+1
| | | | | | | | | | | | In V2, Remove GetImageReadFunction(), directly use PeiImageRead(). The copy PeiImageReadForShadow function doesn't improve the boot performance. This patch removes this copy logic to simplify the code logic. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 40a7b235e4359b4e2eb4d379d1c543b9cae11346)
* MdeModulePkg PeiCore: Not assume PpiDescriptor and Ppi in same rangeStar Zeng2018-08-151-88/+114
| | | | | | | | | | | | | | | | | | | Current code assumes PpiDescriptor and Ppi are in same range (heap/stack/hole). This patch removes the assumption. Descriptor needs to be converted first. It is also handled by this patch. Cc: Liming Gao <liming.gao@intel.com> Cc: Qing Huang <qing.huang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit e9f4a2a934b1d6a0b9a0747f6858c005126d5ae9) # Conflicts: # MdeModulePkg/Core/Pei/Ppi/Ppi.c
* MdeModulePkg/PeiMain: Cleanup whitespace in Reset.cMichael D Kinney2018-02-091-21/+20
| | | | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 8f86d67d464da4d3bf3437575bfd2409da4c800e)
* MdeModulePkg/PeiMain: Always attempt to use Reset2 PPI firstMichael D Kinney2018-02-091-7/+19
| | | | | | | | | | | | | Update PEI Service ResetSystem() to always attempt to use the Reset2 PPI before looking for the Reset PPI. Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 7072a185d06d247f53b6f9b874ba0646cfdf0eef)
* MdeModulePkg PeiCore: Update debug message to print FV handle correctlyLiming Gao2017-12-281-1/+1
| | | | | | | | | BfvHeader->FvLength is UINT64. Now, it prints with %x. It will cause the late FvHandle to be as zero. So, its type is converted to UINT32. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Update PeiCore to pass XCODE tool chainLiming Gao2017-12-051-1/+2
| | | | | | | | It fixes the warning for loop has empty body [-Werror,-Wempty-body]. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liang Vincent <vincent.liang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg PeiCore: Support USED_SIZE FV_EXT_TYPEStar Zeng2017-12-011-3/+87
| | | | | | | | | | | | | | | | The USED_SIZE FV_EXT_TYPE is introduced by PI 1.6 spec. The EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE can be used to find out how many EFI_FVB2_ERASE_POLARITY bytes are at the end of the FV. When the FV gets shadowed into memory you only need to copy the used bytes into memory and fill the rest of the memory buffer with the erase value. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Update PeiCore consumes PCD to get the init value in temp stackLiming Gao2017-11-032-6/+2
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg Core: Propagate PEI-phase FV authentication status to DXEStar Zeng2017-10-101-0/+12
| | | | | | | | | | | | | FV3 HOB was introduced by new (>= 1.5) PI spec, it is intended to be used to propagate PEI-phase FV authentication status to DXE. This patch is to update PeiCore to build FV3 HOB with the authentication status and DxeCore to get the authentication status from FV3 HOB when producing FVB Protocol. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg PeiCore: More debug messages for pre-memory allocationsStar Zeng2017-09-301-1/+13
| | | | | | | | | | The debug messages can help developer to know the pre-memory allocation usage. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg Core: Support FFS_ATTRIB_DATA_ALIGNMENT_2Star Zeng2017-09-261-11/+24
| | | | | | | | | | Follow PI 1.6 spec to support FFS_ATTRIB_DATA_ALIGNMENT_2 for FFS alignment extended to support maximum 16MB. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModule PeiCore: Support pre memory page allocationStar Zeng2017-09-045-53/+646
| | | | | | | | | | | | | Support pre memory page allocation. Support FreePages. Allocation made prior to permanent memory will be migrated to permanent memory and the HOB updated. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <Ruiyu.Ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg PeiCore: Install SEC HOB dataStar Zeng2017-08-044-3/+110
| | | | | | | | | | | | | If the EFI_SEC_HOB_DATA_PPI is in the list of PPIs passed to the PEI entry point, the PEI Foundation will call the GetHobs() member function and install all HOBs returned into the HOB list. It does this after installing all PPIs passed from SEC into the PPI database and before dispatching any PEIMs. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg PeiCore: Handle notification PPI from SECStar Zeng2017-08-013-19/+142
| | | | | | | | | | InstallPpi() will be used for normal PPI in PPI list from SEC, and NotifyPpi() will be used for notification PPI in PPI list from SEC. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg PeiCore: Correct the comments of PeiResetSystem2Star Zeng2017-06-302-4/+4
| | | | | | | Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/PeiCore: avoid EFI_IMAGE_MACHINE_TYPE_SUPPORTED to check archArd Biesheuvel2017-03-291-3/+5
| | | | | | | | | | | | | | | | | | The EFI_IMAGE_MACHINE_TYPE_SUPPORTED() macro is abused in the PeiCore code to decide whether the system we are compiling for can deal with executable code being copied elsewhere and executed from there. As stated in the comment, this is fundamentally a property of the compiler target, and so this should be made dependent on MDE_CPU_xxx preprocessor defines, and not on whether or not the runtime target can deal with PE/COFF images of a certain machine type. On X86/IA32, this mostly boils down to the same thing, but not on other architectures, so let's clean this up. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/PeiCore: honour minimal runtime allocation granularityArd Biesheuvel2017-03-061-2/+37
| | | | | | | | | | | | | | | | Architectures such as AArch64 may run the OS with 16 KB or 64 KB sized pages, and for this reason, the UEFI spec mandates a minimal allocation granularity of 64 KB for regions that may require different memory attributes at OS runtime. So make PeiCore's implementation of AllocatePages () take this into account as well. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Refine casting expression result to bigger sizeHao Wu2017-03-061-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases that the operands of an expression are all with rank less than UINT64/INT64 and the result of the expression is explicitly cast to UINT64/INT64 to fit the target size. An example will be: UINT32 a,b; // a and b can be any unsigned int type with rank less than UINT64, like // UINT8, UINT16, etc. UINT64 c; c = (UINT64) (a + b); Some static code checkers may warn that the expression result might overflow within the rank of "int" (integer promotions) and the result is then cast to a bigger size. The commit refines codes by the following rules: 1). When the expression is possible to overflow the range of unsigned int/ int: c = (UINT64)a + b; 2). When the expression will not overflow within the rank of "int", remove the explicit type casts: c = a + b; 3). When the expression will be cast to pointer of possible greater size: UINT32 a,b; VOID *c; c = (VOID *)(UINTN)(a + b); --> c = (VOID *)((UINTN)a + b); 4). When one side of a comparison expression contains only operands with rank less than UINT32: UINT8 a; UINT16 b; UINTN c; if ((UINTN)(a + b) > c) {...} --> if (((UINT32)a + b) > c) {...} For rule 4), if we remove the 'UINTN' type cast like: if (a + b > c) {...} The VS compiler will complain with warning C4018 (signed/unsigned mismatch, level 3 warning) due to promoting 'a + b' to type 'int'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/PeiCore: allocate BootServicesCode memory for PE/COFF imagesArd Biesheuvel2017-02-281-9/+14
| | | | | | | | | | | Ensure that any memory allocated for PE/COFF images is identifiable as a boot services code region, so that we know it requires its executable permissions to be preserved when we tighten mapping permissions later on. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg PeiCore: Don't cache GUIDED section with AUTH_NOT_TESTEDLiming Gao2017-02-101-11/+13
| | | | | | | | | | If GUIDED section authentication has EFI_AUTH_STATUS_NOT_TESTED, its matched extraction ppi may not be installed. So, don't cache its data. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg PeiCore: Reset PeimNeedingDispatch when its security violationLiming Gao2017-02-101-1/+8
| | | | | | | | | | When PEIM is security violation, its matched extraction ppi may not be installed. So, its PeimNeedingDispatch will still reset to TRUE. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg PeiCore: Make SetPeiServicesTablePointer() early in EntryPointLiming Gao2016-11-291-9/+9
| | | | | | | | | | | | | Make SetPeiServicesTablePointer() earlier than ProcessLibraryConstructorList() so the constructor() function can get the correct pei service table pointer. https://bugzilla.tianocore.org/show_bug.cgi?id=238 Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg PeiCore: Make sure FvInfo has FFS2 format if Ffs2Guid FvFormatStar Zeng2016-10-271-0/+14
| | | | | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=160 Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/Core: Fix typos in commentsGary Lin2016-10-275-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | - paramters -> parameters - funciton -> function - dependecy -> dependency - evauated -> evaluated - genric -> generic - retore -> restore - Protocl -> Protocol - availible -> available - elasped -> elapsed - sarted -> started - boundry -> boundary - permenent -> permanent - debuging -> debugging - availble -> available Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/PeiCore: Fix ConverSinglePpiPointer () typo.Marvin Haeuser2016-08-151-4/+4
| | | | | | | | | Rename ConverSinglePpiPointer () to ConvertSinglePpiPointer (). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Fix typos in comments and variablesGiri P Mudusuru2016-07-111-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - abstrated to abstracted - accessibla to accessible - addres to address - apropriate to appropriate - arry to array - availabe to available - avaliable to available - becasue to because - correponding to corresponding - etablished to established - exeuction to execution - extensiable to extensible - fileds to fields - loadding to loading - ptototypes to prototypes - prococol protocol - requried to required - resoruce to resource - runing to running - uild to build Cc: Star Zeng <star.zeng@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Remove NORETURN for PeiCore() and DxeMain() functionLiming Gao2016-06-232-2/+0
| | | | | | | | | | | | | | PeiCore EntryPoint library _ModuleEntryPoint() will call PeiCore(), then call CpuDeadLoop (). When NORETURN is added for PeiCore(), MSVC compiler will report warning C4702: unreachable code for CpuDeadLoop (). And, the warning is treated as error and cause build break. DxeMain() has the similar issue. edk2 uses EntryPoint library to wrap every module entry point function except for SEC. The module entry point is still called by _ModuleEntryPoint(). So, there will be negative impact to add NORETURN for the module entry point. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/Core: Decorate phase-transition functions with NORETURN.Marvin H?user2016-06-222-0/+6
| | | | | | | | | | | This patch adds the NORETURN attribute to functions that transfer to other phases, along with an UNREACHABLE() call at the end to avoid false warnings. DxeIpl has been excluded as its main function returns a status. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Allow DxeIpl to load without permanent memoryCohen, Eugene2016-05-301-5/+7
| | | | | | | | | | | | | | | | | | PI1.4a spec added "For S3 resume boot modes DXE IPL must be prepared to execute without permanent memory installed and invoke the S3 resume modules." To follow PI1.4a spec, this patch is to update DxeIpl and PeiCore to enable S3 resume from temporary memory. The normal boot path still enforces the permanent memory requirement. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eugene Cohen <eugene@hp.com> Signed-off-by: Star Zeng <star.zeng@intel.com> Tested-by: Katie Dellaquila <katie.dellaquila@hp.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: PeiCore: Fix PEI Multiple Sub-FV Support issueZhang, Chao B2016-05-191-9/+13
| | | | | | | | FirmwareVolmeInfoPpiNotifyCallback is re-enterable during FV process. Since PrivateData->FVCount increases when processing each sub FVs, need to cache Parent FV count in stack before processing any sub FV. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Gao Liming <liming.gao@intel.com>
* MdeModulePkg: Update PeiCore dispatcher to handle PEIM and PEI_CORE onlyLiming Gao2016-02-291-3/+21
| | | | | | | | | | | When PcdShadowPeimOnBoot is FALSE, they are not copied to memory and execute from their original locations. Here, this policy should only apply for PEIM and PEI_CORE, not for other file type, such as DXE_CORE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Tested-by: Eugene Cohen <eugene@hp.com>
* MdeModulePkg/PeiCore: Fix the debug info of PEI temp heap lengthCinnamon Shia2016-01-281-1/+2
| | | | | | | | | | | | | | (HandoffInformationTable->EfiFreeMemoryBottom - Private->HobList.Raw) is the PEI temp heap used instead of the length of PEI temp heap. The length of PEI temp heap should be: (HandoffInformationTable->EfiFreeMemoryTop - Private->HobList.Raw) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19762 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: PeiCore fix Xcode -Wempty-body warningAndrew Fish2015-12-181-9/+9
| | | | | | | | | | | The single line for(); construct is followed by code that is indented. This triggers the -Wempty-body warning. Fix indentation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19420 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Convert all .uni files to utf-8Jordan Justen2015-12-152-0/+0
| | | | | | | | | | | | | To convert these files I ran: $ python3 BaseTools/Scripts/ConvertUni.py MdeModulePkg Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19257 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg PeiCore: PeiInstallPeiMemory improper ASSERT test on second callStar Zeng2015-11-181-1/+1
| | | | | | | | | | | | The ASSERT (PrivateData->PeiMemoryInstalled) in if (PrivateData->PeiMemoryInstalled) condition is useless, it should be ASSERT (FALSE) to follow the code's expectation. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18887 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg PeiCore: PEI dispatcher need retry to process NOT_DISPATCHED FVStar Zeng2015-11-131-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | A corner case like below will cause a NOT_DISPATCHED FV has no opportunity to be dispatched. 1. FV_RECOVERY has SecCore, PeiCore and some other PEI modules, a module will report FVMAIN_COMPACT and FV_RECOVERY2 in sequence. 2. FVMAIN_COMPACT has a FV image file with GUIDED FV image section in it. 3. FV_RECOVERY2 has DxeIpl and other PEI modules, the DxeIpl will install SectionExtractionPpi If ALL the PEIMs in FV_RECOVERY and FV_RECOVERY2 have DEPEX satisfied and executed in one loop, PeimNeedingDispatch will be always FALSE, FVMAIN_COMPACT will have no opportunity to be decompressed and dispatched as DxeIpl executes after the first processing to FVMAIN_COMPACT. The patch is to set PeimNeedingDispatch to TRUE when ProcessFvFile() not successfully, then the NOT_DISPATCHED FV could have another opportunity to be processed. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18781 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg PeiCore: Fix issue AuthenticationStatus is not propagated correctlyEugene Cohen2015-11-101-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes an issue in PEI with encapsulated FV images where the AuthenticationStatus is not correctly propagated down to child FV handles. The PEI core registers for callbacks for both FvInfo and FvInfo2 PPIs. These callbacks process the FVs which will recurse as necessary to find more encapsulated FVs. (FvInfo2 is an updated PPI that includes an AuthenticationStatus field - the original FvInfo did not include this.) When encapsulated FV processing occurs the PEI core installs both FvInfo and FvInfo2 PPIs. The original implementation installs FvInfo first and FvInfo2 second. As soon as the FvInfo PPI is installed the notification callback handler immediately fires causing recursive FV processing to occur. Since there is no AuthenticationStatus provided for the original FvInfo the callback assumes AuthenticationStatus is zero (unsigned / unverified) even though the parent FV may have been verified. This changes the order of FvInfo and FvInfo2 installs to ensure that the notification callback occurs for FvInfo2 first and appropriate AuthenticationStatus data can be propagated from parent FV to child FV. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18764 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg PeiCore: Recheck SwitchStackSignal after ProcessNotifyList()Star Zeng2015-08-251-263/+293
| | | | | | | | | | | | | | | in case PeiInstallPeiMemory() is done in a callback with EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH, and the callback is registered on a PPI that is installed in the last PEIM. At the case, PeiCore SwitchStack code will be not being invoked. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18305 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg PeiCore: Add PCD to specify PEIM ShadowLiming Gao2015-08-034-9/+52
| | | | | | | | | | | | | | | | | v2 changelog: Check CurrentPeimHandle to check the matched PeimHandle. Add check point to ShadowPeiCore based on PCD. v1 changelog: PeiCore LoadImage always shadow itself and PEIM on normal boot after the physical memory is installed. On the emulator platform, the shadow may be not necessary. To support such usage, new PCD PcdShadowPeimOnBoot is introduced to specify whether loads PEIM in memory by default. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18125 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Update PeiCore to handle specific child FVLiming Gao2015-06-251-2/+20
| | | | | | | | | | | | Child FV may be placed in parent FV image without process required. Then, Child FV and parent FV will be in the same continuous space. For FileHandle, FileHandleToVolume() function needs to find the best matched FV handle. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17704 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Update implementation of PeiAllocatePages() to allow ↵Star Zeng2015-05-111-2/+3
| | | | | | | | | | EfiReservedMemoryType. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17394 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add Reset2 ppi support in PEI CORE.Star Zeng2015-05-114-3/+78
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17389 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: add error handling when DXE IPL PPI is not found.Elvin Li2015-04-011-1/+12
| | | | | | | | | | Add status code report and cpu deadloop when DXE IPL PPI is not found. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Elvin Li <elvin.li@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17087 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Remove unused internal structure in PeiCoreLiming Gao2015-03-311-12/+4
| | | | | | | | | | | | | | PeiCore calls REPORT_STATUS_CODE_WITH_EXTENDED_DATA() with its internal structure for Image dispatcher. No code consumes it. But, it brings confuse. DxeCore and SmmCore calls REPORT_STATUS_CODE_WITH_EXTENDED_DATA() with Handle only. To be consistent, update PeiCore to be same to DxeCore and SmmCore. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17085 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Fix typo.Shumin Qiu2015-03-131-4/+4
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Shumin Qiu <shumin.qiu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17045 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePke: PeiCore FirmwareVolmeInfoPpiNotifyCallback ()issueLiming Gao2014-12-151-6/+6
| | | | | | | | | | | | | PeiCore FirmwareVolmeInfoPpiNotifyCallback() should check FvCount when new one is added. Now, this check is the entry of Notify function that is too early, because PeiCore will install FvInfo and FvInfo2 both for one sub FV image and trig FvNotify function twice for the same FV images. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16520 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg PeiCore: Update the code of PeiAllocatePages() to correctly ↵Star Zeng2014-10-141-6/+10
| | | | | | | | | | | | | | | consider the overhead sizeof (EFI_HOB_MEMORY_ALLOCATION). It can fix the confused ERROR log like below. "AllocatePages failed: No 0x1 Pages is available. There is only left 0x1 pages memory resource to be allocated." Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16211 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Convert non DOS format files to DOS format and remove unused ↵Gao, Liming2014-09-031-0/+0
| | | | | | | | | | | | module UNI files. 1. Module UNI and Package UNI files are not DOS format. Convert them to DOS format. 2. Remove unused SectionExtractionDxeModStrs.uni and SectionExtractionPeiModStrs.uni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16044 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: INF/DEC file updates to EDK II packagesZeng, Star2014-08-282-0/+0
| | | | | | | | | | | | | | | | | | 2. Add MODULE_UNI_FILE file that contains the localized Abstract and Description of a module. a. Addresses an information gap between INF files and the UEFI Distribution Packaging Specification XML schema b. There will be an associated update to UPT in BaseTools to consume MODULE_UNI_FILE and associated UNI file during UDP creation that performs the INF -> XML conversion. c. There will be an associated update to UPT in BaseTools to produce MODULE_UNI_FILE and associated UNI file during UDP installation that performs the XML -> INF conversion. 3. Add Module Extra UNI file that provides the localized Name of a module. a. [UserExtensions.TianoCore."ExtraFiles"] provides an easy method for a module to specify extra files not listed in [Sources] or [Binaries] sections to be added to a UDP without having to list the files in the UPT package information data file. b. There will be an associated update to UPT in BaseTools to package up files listed in [UserExtensions.TianoCore."ExtraFiles"] during UDP creation. c. UNI file contains localized name of a module to go along with the localized Abstract and Description from the MODULE_UNI_FILE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zeng, Star <star.zeng@intel.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15963 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: INF/DEC file updates to EDK II packagesZeng, Star2014-08-281-22/+53
| | | | | | | | | | | | 1. Usage information in INF file comment blocks are either incomplete or incorrect. This includes usage information for Protocols/PPIs/GUIDs/PCDs/HOBs/Events/BootModes. The syntax for usage information in comment blocks is defined in the EDK II Module Information (INF) Specification Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zeng, Star <star.zeng@intel.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15962 6f19259b-4bc3-4df7-8a09-765794883524