summaryrefslogtreecommitdiff
path: root/UefiCpuPkg/Library
AgeCommit message (Collapse)Author
2017-04-27UefiCpuPkg: Move to new locationGuo Mang
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang <mang.guo@intel.com>
2017-04-07UefiCpuPkg/CpuExceptionHandlerLib: Remove white space at first lineJeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com>
2017-04-07UefiCpuPkg/CpuExceptionHandlerLib: Trim white space at end of lineJeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com>
2017-04-07UefiCpuPkg/CpuExceptionHandlerLib: Add DumpCpuContext() implementationJeff Fan
Export DumpCpuCotext() to display CPU Context. We will invoke PeCoffGetEntrypointLib's PeCoffSerachImageBase() to get PE/COFF image base. Display exception data bit value for page fault exception. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-04-06UefiCpuPkg/MpLib.c: Load microcode before mtrr sync per IA32 SDMJeff Fan
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=453 Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-04-05UefiCpuPkg/CpuFeatures: Change files format to DOSJeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-04-05UefiCpuPkg/MtrrLib:Fix VS2012 build failureDandan Bi
Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: Fix GCC build failureRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: All functions use definitions in Msr.hRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: Refine MtrrGetMemoryAttributeByAddressWorkerRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: Use a better algorithm to calculate MTRRRuiyu Ni
The new algorithm finds out the more optimal MTRR solution for current memory type settings. Compare against the original algorithm, the new one guarantees to find the correct MTRR solution, but doesn't guarantee to find the most optimal MTRR solution. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: MtrrLibInitializeMtrrMask() uses definitions in CpuId.hRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: Add MtrrLib prefix to several internal functionsRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: Add MtrrLib prefix to ProgramFixedMtrrRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: GetVariableMtrrCountWorker uses definitions in Msr.hRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: IsMtrrSupported uses definitions in Msr.hRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-31UefiCpuPkg/MtrrLib: Correct typo in comments and remove TABsRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-03-28UefiCpuPkg/MpLib.c: Add checking CR0 PG bitJeff Fan
If CR0 PG bit is not set, it means paging is not enabled on BSP. Thus, Execute Disable feature is not working actually. Thus, we cannot enable it on APs. v2: Correct the commit log. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-28UefiCpuPkg/CpuCommonFeaturesLib: Generate new INF GUID valueJeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-28UefiCpuPkg/RegisterCpuFeaturesLib: Fix meta data commentsJeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-28UefiCpuPkg/RegisterCpuFeaturesLib: Remove static typeJeff Fan
Using one specific name for global variable to save MP services protocol pointer. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-28UefiCpuPkg/RegisterCpuFeaturesLib: Fix the function header issuesJeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-27UefiCpuPkg/RegisterCpuFeaturesLib: Add ASSERT on allocated memoryJeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-27UefiCpuPkg/AcpiCpuData.h: Support >4GB MMIO addressJeff Fan
The current CPU_REGISTER_TABLE_ENTRY structure only defined UINT32 Index to indicate MSR/MMIO address. It's ok for MSR because MSR address is UINT32 type actually. But for MMIO address, UINT32 limits MMIO address exceeds 4GB. This update on CPU_REGISTER_TABLE_ENTRY is to add additional UINT32 field HighIndex to indicate the high 32bit MMIO address and original Index still indicate the low 32bit MMIO address. This update makes use of original padding space between ValidBitLength and Value to add HighIndex. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-27UefiCpuPkg/RegisterCpuFeaturesLib: Define Index to UINT64Jeff Fan
The input parameter Index of PreSmmCpuRegisterTableWrite() and CpuRegisterTableWrite() is defined as UINT32. Index is MSR/MMIO address that will be saved in CPU register table. UINT32 blocks the MMIO address > 4GB. This fix is to define Index to UINT64 instead of UINT32. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-23UefiCpuPkg/RegisterCpuFeaturesLib: Set CpuFeatureEntry initial valueJeff Fan
CpuFeatureEntry will be set before using it. But VS2012 build reported the build warning "potentially uninitialized local variable 'CpuFeatureEntry' used". This fix is to set CpuFeatureEntry initial value and add ASSERT check later. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-23UefiCpuPkg/CpuCommonFeaturesLib: Fix case write issueJeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-22UefiCpuPkg: Add NULL CPU Common Features Library instanceJeff Fan
This NULL CPU common Features Library instance will register some CPU features defined in Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 3, September 2016, Chapter 35 Model-Specific-Registers (MSR). Add PCD PcdCpuClockModulationDutyCycle and PcdIsPowerOnReset consumed by NULL CPU Common Features Library instance. v2: 1. Using MSR_IA32_EFER to enable/disable NX feature instead of using MSR_IA32_MISC_ENABLE. 2. Fix bug that SMX and VMX feature is swapped. v3: 1. Add AesniGetConfigData() to get current register state. v5: Move MSR reading from AesniGetConfigData() to AesniSupport(). Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-22UefiCpuPkg: Add PEI/DXE Register CPU Features Library instancesJeff Fan
PEI Register CPU Features Library instance is used to register/manager/program CPU features on PEI phase. DXE Register CPU Features Library instance is used to register/manager/program CPU features on DXE phase. v2: Format debug messages. v3: Trim white space at end of line. v4: Remove unused local variable. Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-06UefiCpuPkg: Refine casting expression result to bigger sizeHao Wu
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: Jeff Fan <jeff.fan@intel.com>
2017-02-22UefiCpuPkg/ExceptionHandlerAsm.S: Fix code length issue with GCC 5.4Jeff Fan
X64\ExceptionHandlerAsm.S define MARCO to set up 32 IDT entries header. It assume GCC compiler will generate the same code length on the following instrction for each IDT entry. jmp ASM_PFX(CommonInterruptEntry) It works with GCC 4.x. However, GCC 5.4 will generate different code size of IDT entry code per the offset value from CommonInterruptEntry address. We should use DB to make sure each IDT entry header has the same size whatever compiler version. .ASM and .nasm used the different solution and do not have this issue. https://bugzilla.tianocore.org/show_bug.cgi?id=389 Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-16UefiCpuPkg/MpInitLib: Add missing point markJeff Fan
Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2016-12-30UefiCpuPkg/MpInitLib: Set initialize value of TimerPeriodJeff Fan
This fix is to pass VS2010/VS2012 build. Cc: Feng Tian <feng.tian@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2016-12-28UefiCpuPkg/MpInitLib: Set new AP to idle state after switching BSPJeff Fan
We need to set new AP to idle state if it is expected to be waken up by new BSP later. Cc: Feng Tian <feng.tian@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-28UefiCpuPkg/MpInitLib: Disable and restore system timer interruptJeff Fan
We need to disable system timer interrup to avoid generating the pending interrupt on the old BSP. Cc: Feng Tian <feng.tian@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-28UefiCpuPkg/MpInitLib: Swap local APIC timer interrupt stateJeff Fan
We need to swap local APIC timer interrupt state between old BSP and new BSP. Cc: Feng Tian <feng.tian@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-28UefiCpuPkg/MpInitLib: Move save/restore interrupt to SwitchBSPWorker()Jeff Fan
During switching BSP phase, we need to disable CPU interruput to prevent stack crashed by Timer interrupt handle. But when we enabled source debugging feature, debug timer interrupt handler (existing on both PEI and DXE) also could crash the stack used during switching BSP. So,we need to move save/restore interrupt to SwitchBSPWorker(). Cc: Feng Tian <feng.tian@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-28UefiCpuPkg/MpInitLib: Sync BSP's local APIC timer settings to APsJeff Fan
If APs are waken up by INIT-SIPI-SIPI command, they will lose original local APIC timer setting. As a result, the timer library instance based on local APIC timer cannot work on APs function. This fix is to save BSP's local APIC timer settings before waking up APs and to sync to APs when APs wakeup by INIT-SIPI-SIPI command. Setting BSP's current counter to AP's initial counter could make sure BSP and APs have same counter value across BSP switching. Cc: Feng Tian <feng.tian@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-28UefiCpuPkg/DxeMpInitLib: Support source debugging on AP functionJeff Fan
The current DxeDebugAgentLib supports source debugging on AP function. This update is to update DxeMpInitLib to consume Debug Agent Library by DEBUG_AGENT_INIT_DXE_AP flag. Thus, we could source debugging AP function invoked by CPU MP Protocol. However, current SecPeiDebugAgentLib does not support source debugging on AP function invoked by CPU MP PPI. I have submitted one bugzilla to add this support at https://bugzilla.tianocore.org/show_bug.cgi?id=308. Cc: Feng Tian <feng.tian@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-21UefiCpuPkg/SmmCpuFeaturesLib: Fix coding style issuesDandan Bi
Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
2016-12-19UefiCpuPkg/SmmCpuFeaturesLibStm: Add STM library instanceMichael Kinney
Add a new instances of the SmmCpuFeaturesLib that is used by platforms to enable the SMI Transfer Monitor(STM) feature. This new instance is in the same directory as the default SmmCpuFeaturesLib instance in order to share source files. The DSC file is updated to build both SmmCpuFeatureLib instances and to build two versions of the PiSmmCpuDxeSmm module using each of the SmmCpuFeatureLib instances. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-12-19UefiCpuPkg/SmmCpuFeaturesLib: Split into two filesMichael Kinney
Split the default implementation of the SmmCpuFeaturesLib into two files to prepare for the addition of the STM specific SmmCpuFeaturesLib implementation. The STM specific implementation installs a different SMI entry handler and initialize the MSEG specific MSR at the end of SmmCpuFeaturesInitializeProcessor(). This patch does not introduce any functional changes to the default implementation of the SmmCpuFeaturesLib. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-12-14UefiCpuPkg: Make the comments align with the functionsDandan Bi
Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-12-01UefiCpuPkg/CpuExceptionHandlerLib: remove un-used mReservedVectorsJeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-01UefiCpuPkg: Add ExceptionHandlerData for ArchRestoreExceptionContext()Jeff Fan
mReservedVectors is not set, we could add parameter ExceptionHandlerData for ArchRestoreExceptionContext() that could use it instead of mReservedVectors. Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-01UefiCpuPkg: Add ExceptionHandlerData for ArchSaveExceptionContext()Jeff Fan
mReservedVectors is not set, we could add parameter ExceptionHandlerData for ArchSaveExceptionContext() that could use it instead of mReservedVectors. Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-11-29UefiCpuPkg/MpInitLib: wait no longer than necessary for initial AP startupLaszlo Ersek
Sometimes a platform knows exactly how many CPUs it has at boot. It should be able to - set PcdCpuMaxLogicalProcessorNumber dynamically to this number, - set PcdCpuApInitTimeOutInMicroSeconds to a very long time (for example MAX_UINT32, approx. 71 minutes), - and expect that MpInitLib wait exactly as long as necessary for all APs to report in. Other platforms should be able to continue setting a reasonably large upper bound on supported CPUs, and waiting for a reasonable, fixed amount of time for all APs to report in. Add this functionality. The TimedWaitForApFinish() function will return when all APs have reported in, or the timeout has expired -- whichever happens first. (Accessing these PCDs dynamically is safe. The PEI and DXE phase instances of this library are restricted to PEIM and DXE_DRIVER client modules, thus the PCD accesses cannot be linked into runtime code.) Cc: Igor Mammedov <imammedo@redhat.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=116 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-11-28UefiCpuPkg/DxeMpLib: Remove unnecessary ret instructionJeff Fan
Reported-by: Laszlo Ersek <lersek@redhat.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-11-28UefiCpuPkg/DxeMpLib: Fix bug when getting target C-State from eaxJeff Fan
AP will get target C-State from eax[7:4]. We do shift in ebx firstly before set to eax. It will lead ebx is incorrect in the next time. The fix is to set ebx to eax firstly and does shift in eax. Thus, ebx could keep original value. Reported-by: Laszlo Ersek <lersek@redhat.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-11-28UefiCpuPkg/DxeMpLib: Make sure APs in safe loop codeJeff Fan
Add one semaphore to make sure BSP to wait till all APs run in AP safe loop code. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>