16 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
17 &gEfiSecPlatformInformation2PpiGuid,
18 &mSecPlatformInformation2Ppi
37 IN OUT UINT64 *StructureSize,
46 if (GuidHob ==
NULL) {
51 DataInHob = GET_GUID_HOB_DATA (GuidHob);
52 DataSize = GET_GUID_HOB_DATA_SIZE (GuidHob);
57 if ((*StructureSize) < (UINT64)DataSize) {
58 *StructureSize = (UINT64)DataSize;
59 return EFI_BUFFER_TOO_SMALL;
62 *StructureSize = (UINT64)DataSize;
63 CopyMem (PlatformInformationRecord2, DataInHob, DataSize);
88 OUT VOID **BistInformationData,
89 OUT UINT64 *BistInformationSize OPTIONAL
95 UINT64 InformationSize;
101 (VOID **)&SecPlatformInformation2Ppi
103 if (Status == EFI_NOT_FOUND) {
104 return EFI_NOT_FOUND;
113 Status = SecPlatformInformation2Ppi->PlatformInformation2 (
118 if (Status == EFI_BUFFER_TOO_SMALL) {
120 (
UINTN)InformationSize,
127 Status = SecPlatformInformation2Ppi->PlatformInformation2 (
134 if (BistInformationSize !=
NULL) {
135 *BistInformationSize = InformationSize;
144 return EFI_DEVICE_ERROR;
168 UINTN ProcessorNumber;
172 UINTN NumberOfProcessors;
173 UINTN NumberOfEnabledProcessors;
174 UINTN BistInformationSize;
181 if (EFI_ERROR (Status)) {
182 NumberOfProcessors = 1;
183 NumberOfEnabledProcessors = 1;
189 (
UINTN)BistInformationSize,
190 (VOID **)&PlatformInformationRecord2
193 PlatformInformationRecord2->
NumberOfCpus = (UINT32)NumberOfProcessors;
204 &gEfiSecPlatformInformation2PpiGuid,
205 &SecInformationDescriptor,
221 &gEfiSecPlatformInformationPpiGuid,
222 &SecInformationDescriptor,
234 CpuInstance = &BspCpuInstance;
236 DEBUG ((DEBUG_INFO,
"Does not find any stored CPU BIST information from PPI!\n"));
240 for (ProcessorNumber = 0; ProcessorNumber < NumberOfProcessors; ProcessorNumber++) {
242 for (CpuIndex = 0; CpuIndex < NumberOfData; CpuIndex++) {
243 ASSERT (CpuInstance !=
NULL);
244 if (ProcessorInfo.
ProcessorId == CpuInstance[CpuIndex].CpuLocation) {
248 BistData = CpuInstance[CpuIndex].InfoRecord.IA32HealthFlags;
252 if (BistData.Uint32 != 0) {
257 EFI_ERROR_CODE | EFI_ERROR_MAJOR,
258 (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST)
264 " APICID - 0x%08x, BIST - 0x%08x\n",
268 CpuInstanceInHob = PlatformInformationRecord2->CpuInstance;
269 CpuInstanceInHob[ProcessorNumber].CpuLocation = (UINT32)ProcessorInfo.
ProcessorId;
270 CpuInstanceInHob[ProcessorNumber].InfoRecord.IA32HealthFlags = BistData;
278 &gEfiSecPlatformInformation2PpiGuid,
279 PlatformInformationRecord2,
280 (
UINTN)BistInformationSize
284 if (NumberOfData < NumberOfProcessors) {
289 SecInformationDescriptor,
290 &mPeiSecPlatformInformation2Ppi
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS EFIAPI SecPlatformInformation2(IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT UINT64 *StructureSize, OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2)
VOID CollectBistDataFromPpi(IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS GetBistInfoFromPpi(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_GUID *Guid, OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, OUT VOID **BistInformationData, OUT UINT64 *BistInformationSize OPTIONAL)
EFI_STATUS EFIAPI PeiServicesAllocatePool(IN UINTN Size, OUT VOID **Buffer)
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
EFI_STATUS EFIAPI PeiServicesInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_STATUS EFIAPI PeiServicesReInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi, IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi)
UINT32 EFIAPI GetInitialApicId(VOID)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define REPORT_STATUS_CODE(Type, Value)
EFI_STATUS EFIAPI MpInitLibGetNumberOfProcessors(OUT UINTN *NumberOfProcessors OPTIONAL, OUT UINTN *NumberOfEnabledProcessors OPTIONAL)
EFI_STATUS EFIAPI MpInitLibGetProcessorInfo(IN UINTN ProcessorNumber, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer, OUT EFI_HEALTH_FLAGS *HealthData OPTIONAL)