+\r
+/**\r
+ Get CPUs' BIST by calling SecPlatformInformationPpi/SecPlatformInformation2Ppi.\r
+\r
+**/\r
+VOID\r
+RepublishSecPlatformInformationPpi (\r
+ VOID\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ CONST EFI_PEI_SERVICES **PeiServices;\r
+ UINT64 BistInformationSize;\r
+ VOID *BistInformationData;\r
+ EFI_PEI_PPI_DESCRIPTOR *SecInformationDescriptor;\r
+\r
+ PeiServices = GetPeiServicesTablePointer ();\r
+ Status = GetBistInfoFromPpi (\r
+ PeiServices,\r
+ &gEfiSecPlatformInformation2PpiGuid,\r
+ &SecInformationDescriptor,\r
+ &BistInformationData,\r
+ &BistInformationSize\r
+ );\r
+ if (Status == EFI_SUCCESS) {\r
+ BuildGuidDataHob (\r
+ &gEfiCallerIdGuid,\r
+ BistInformationData,\r
+ (UINTN) BistInformationSize\r
+ );\r
+ //\r
+ // The old SecPlatformInformation data is on CAR.\r
+ // After memory discovered, we should never get it from CAR, or the data will be crashed.\r
+ // So, we reinstall SecPlatformInformation PPI here.\r
+ //\r
+ Status = PeiServicesReInstallPpi (\r
+ SecInformationDescriptor,\r
+ &mPeiSecPlatformInformation2\r
+ );\r
+ } if (Status == EFI_NOT_FOUND) {\r
+ Status = GetBistInfoFromPpi (\r
+ PeiServices,\r
+ &gEfiSecPlatformInformationPpiGuid,\r
+ &SecInformationDescriptor,\r
+ &BistInformationData,\r
+ &BistInformationSize\r
+ );\r
+ if (Status == EFI_SUCCESS) {\r
+ BuildGuidDataHob (\r
+ &gEfiCallerIdGuid,\r
+ BistInformationData,\r
+ (UINTN) BistInformationSize\r
+ );\r
+ //\r
+ // The old SecPlatformInformation2 data is on CAR.\r
+ // After memory discovered, we should never get it from CAR, or the data will be crashed.\r
+ // So, we reinstall SecPlatformInformation2 PPI here.\r
+ //\r
+ Status = PeiServicesReInstallPpi (\r
+ SecInformationDescriptor,\r
+ &mPeiSecPlatformInformation\r
+ );\r
+ }\r
+ }\r
+\r
+ ASSERT_EFI_ERROR(Status);\r
+}\r