## @file\r
# Simple CPU driver installs CPU Architecture Protocol.\r
#\r
-# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
CpuExceptionHandlerLib\r
TimerLib\r
SynchronizationLib\r
+ HobLib\r
+ ReportStatusCodeLib\r
\r
[Sources]\r
ApStartup.c\r
gIdleLoopEventGuid ## CONSUMES ## Event\r
gEfiVectorHandoffTableGuid ## SOMETIMES_CONSUMES ## SystemTable\r
\r
+[Ppis]\r
+ gEfiSecPlatformInformation2PpiGuid ## UNDEFINED # HOB\r
+ gEfiSecPlatformInformationPpiGuid ## UNDEFINED # HOB\r
+\r
[Pcd]\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber ## CONSUMES\r
gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize ## CONSUMES\r
/** @file\r
CPU DXE Module.\r
\r
- Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Collects BIST data from HOB.\r
+\r
+ This function collects BIST data from HOB built from Sec Platform Information\r
+ PPI or SEC Platform Information2 PPI.\r
+\r
+**/\r
+VOID\r
+CollectBistDataFromHob (\r
+ VOID\r
+ )\r
+{\r
+ EFI_HOB_GUID_TYPE *GuidHob;\r
+ EFI_SEC_PLATFORM_INFORMATION_RECORD2 *SecPlatformInformation2;\r
+ EFI_SEC_PLATFORM_INFORMATION_RECORD *SecPlatformInformation;\r
+ UINTN NumberOfData;\r
+ EFI_SEC_PLATFORM_INFORMATION_CPU *CpuInstance;\r
+ EFI_SEC_PLATFORM_INFORMATION_CPU BspCpuInstance;\r
+ UINTN ProcessorNumber;\r
+ UINT32 InitialLocalApicId;\r
+ CPU_DATA_BLOCK *CpuData;\r
+\r
+ SecPlatformInformation2 = NULL;\r
+ SecPlatformInformation = NULL;\r
+\r
+ //\r
+ // Get gEfiSecPlatformInformation2PpiGuid Guided HOB firstly\r
+ //\r
+ GuidHob = GetFirstGuidHob (&gEfiSecPlatformInformation2PpiGuid);\r
+ if (GuidHob != NULL) {\r
+ //\r
+ // Sec Platform Information2 PPI includes BSP/APs' BIST information\r
+ //\r
+ SecPlatformInformation2 = GET_GUID_HOB_DATA (GuidHob);\r
+ NumberOfData = SecPlatformInformation2->NumberOfCpus;\r
+ CpuInstance = SecPlatformInformation2->CpuInstance;\r
+ } else {\r
+ //\r
+ // Otherwise, get gEfiSecPlatformInformationPpiGuid Guided HOB\r
+ //\r
+ GuidHob = GetFirstGuidHob (&gEfiSecPlatformInformationPpiGuid);\r
+ if (GuidHob != NULL) {\r
+ SecPlatformInformation = GET_GUID_HOB_DATA (GuidHob);\r
+ NumberOfData = 1;\r
+ //\r
+ // SEC Platform Information only includes BSP's BIST information\r
+ // does not have BSP's APIC ID\r
+ //\r
+ BspCpuInstance.CpuLocation = GetApicId ();\r
+ BspCpuInstance.InfoRecord.IA32HealthFlags.Uint32 = SecPlatformInformation->IA32HealthFlags.Uint32;\r
+ CpuInstance = &BspCpuInstance;\r
+ } else {\r
+ DEBUG ((EFI_D_INFO, "Does not find any HOB stored CPU BIST information!\n"));\r
+ //\r
+ // Does not find any HOB stored BIST information\r
+ //\r
+ return;\r
+ }\r
+ }\r
+\r
+ while (NumberOfData--) {\r
+ for (ProcessorNumber = 0; ProcessorNumber < mMpSystemData.NumberOfProcessors; ProcessorNumber++) {\r
+ CpuData = &mMpSystemData.CpuDatas[ProcessorNumber];\r
+ InitialLocalApicId = (UINT32) CpuData->Info.ProcessorId;\r
+ if (InitialLocalApicId == CpuInstance[NumberOfData].CpuLocation) {\r
+ //\r
+ // Update CPU health status for MP Services Protocol according to BIST data.\r
+ //\r
+ if (CpuInstance[NumberOfData].InfoRecord.IA32HealthFlags.Uint32 != 0) {\r
+ CpuData->Info.StatusFlag &= ~PROCESSOR_HEALTH_STATUS_BIT;\r
+ //\r
+ // Report Status Code that self test is failed\r
+ //\r
+ REPORT_STATUS_CODE (\r
+ EFI_ERROR_CODE | EFI_ERROR_MAJOR,\r
+ (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST)\r
+ );\r
+ }\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
/**\r
Callback function for ExitBootServices.\r
\r
\r
mAPsAlreadyInitFinished = TRUE;\r
\r
+ //\r
+ // Update CPU healthy information from Guided HOB\r
+ //\r
+ CollectBistDataFromHob ();\r
+\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&mMpServiceHandle,\r
&gEfiMpServiceProtocolGuid, &mMpServicesTemplate,\r
/** @file\r
CPU DXE MP support\r
\r
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#ifndef _CPU_MP_H_\r
#define _CPU_MP_H_\r
\r
+#include <Ppi/SecPlatformInformation.h>\r
+#include <Ppi/SecPlatformInformation2.h>\r
#include <Protocol/MpService.h>\r
#include <Library/SynchronizationLib.h>\r
+#include <Library/HobLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
\r
/**\r
Initialize Multi-processor support.\r
## @file\r
# UefiCpuPkg Package\r
#\r
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf\r
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf\r
- CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf \r
+ CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf\r
\r
[LibraryClasses.common.PEIM]\r
\r
[LibraryClasses.IPF.PEIM]\r
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointerLibKr7.inf\r
- \r
+\r
[LibraryClasses.common.DXE_DRIVER]\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
+ HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
\r
[LibraryClasses.common.DXE_SMM_DRIVER]\r
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf\r
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf\r
- \r
+\r
#\r
# Drivers/Libraries within this package\r
#\r
UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf\r
UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf\r
UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf\r
- UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf \r
+ UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf\r
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf\r
\r