Jeff Fan
c972495ed0
UefiCpuPkg/CpuMpPei: Fix typo and add some comments
...
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 >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19090 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-02 00:44:05 +00:00
Jeff Fan
f40a7de450
UefiCpuPkg/CpuMpPei: Save/Restore CRx/DRx register for APs waking up
...
PeiStartupAllAPs()/PeiStartupThisAP() will send INIT-SIPI-SIPI to wakeup APs to
execute AP function. However, some registers will be reset after APs received
INIT IPI. We need to restore some registers (For example, CRx/DRx) manually
after APs wakeup.
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 >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19089 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-02 00:43:45 +00:00
Jeff Fan
22cfe73a12
UefiCpuPkg/CpuMpPei: Sync BSP's CRx to APs when initialization
...
Save BSP's volatile register and sync CRx register to APs when AP 1st wake up.
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 >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19088 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-02 00:43:19 +00:00
Jeff Fan
10c6c206da
UefiCpuPkg/CpuMpPei: Set AP state to CpuStateIdle after initialization
...
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 >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19087 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-02 00:42:59 +00:00
Jeff Fan
ef1fdb8098
UefiCpuPkg/CpuMpPei: Add CPU_VOLATILE_REGISTERS & worker functions
...
Add CPU_VOLATILE_REGISTERS definitions for CRx and DRx required to be restored
after APs received INIT IPI.
Add worker functions SaveVolatileRegisters()/RestoreVolatileRegisters() used to
save/restore CRx and DRx. It also check if Debugging Extensions supported or
not.
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 >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19086 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-02 00:42:40 +00:00
Jeff Fan
24930b5609
UefiCpuPkg/CpuMpPei: Exchange whole CPU data in SortApicId()
...
Current implementation only exchanges the APIC ID and BIST, this updating is to
exchange all CPU data.
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 >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19085 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-02 00:42:09 +00:00
Jeff Fan
c7981a1184
UefiCpuPkg/CpuMpPei: Enable x2APIC mode on BSP/APs
...
If x2APIC flag is set, enable x2APIC mode on all APs and BSP. Before we wakeup
APs to enable x2APIC mode, we should wait all APs have finished initialization.
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: Michael Kinney <michael.d.kinney@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18934 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-25 02:47:59 +00:00
Jeff Fan
2f0261b7dc
UefiCpuPkg/CpuMpPei: Set X2APIC flag if one x2APIC ID larger than 254
...
If there are any logical processor reporting an APIC ID of 255 or greater, set
X2ApicEnable flag.
GetInitialApicId() will return x2APIC ID if CPUID leaf B supported.
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: Michael Kinney <michael.d.kinney@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18933 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-25 02:47:34 +00:00
Michael Kinney
944f45ae2f
UefiCpuPkg: Update CPU MP drivers to support single CPU configuration
...
Only perform AP detection if PcdCpuMaxLogicalProcessorNumber > 1
Only free AP related structures of they were allocated
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com >
Reviewed-by: Jeff Fan <jeff.fan@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18629 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:07:52 +00:00
Jeff Fan
28f27af6f0
UefiCpuPkg/CpuMpPei: Fix wrong CpuData pointer
...
CpuData buffer should be located in allocated buffer instead of at end of
WakeupBuffer.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Star Zeng <star.zeng@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18550 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-25 06:29:51 +00:00
Jeff Fan
630699bd80
UefiCpuPkg/CpuMpPei: Add check on Processors number found
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Star Zeng <star.zeng@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18549 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-25 06:29:03 +00:00
Jeff Fan
ea0f431cec
UefiCpuPkg/CpuMpPei: Update files format to DOS
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18168 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-06 06:57:47 +00:00
Jeff Fan
8f7b315b1c
UefiCpuPkg/CpuMpPei: Register callback on End Of Pei PPI
...
Add CpuMpEndOfPeiCallback () to restore wakeup buffer data on S3 path and flag
flag wakeup buffer to be un-used type on normal boot path. Set one EndOfPei
flag save/restore wakeup buffer when wakeup APs every time.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18014 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:46:13 +00:00
Jeff Fan
fcc82734bf
UefiCpuPkg/CpuMpPei: Add AsmHltLoop ()
...
Add AsmHltLoop () in assembly code, it will not be copied into AP wakeup
buffer and invoked at end of ApCFunction (). To make sure AP work in case
AP wakeup buffer is restored to original data.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18013 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:45:45 +00:00
Jeff Fan
e35d034736
UefiCpuPkg/CpuMpPei: Install PI CPU MP PPI
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18012 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:45:11 +00:00
Jeff Fan
60ca9e8c18
UefiCpuPkg/CpuMpPei: Implementation of PeiStartupAllAPs ()
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18008 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:43:12 +00:00
Jeff Fan
a21fe4285e
UefiCpuPkg/CpuMpPei: Update and publish CPU BIST information
...
Get CPU BIST information from SEC Platform Information(2) PPIs and update them
accordingly. Install(Reinstall) SEC Platform Information2 PPI to published the
new CPU BIST.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18004 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:41:33 +00:00
Jeff Fan
8805c91231
UefiCpuPkg/CpuMpPei: Build one GUIDed HOB to save CPU MP Data
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18003 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:41:07 +00:00
Jeff Fan
d1cf93333f
UefiCpuPkg/CpuMpPei: Load microcode on BSP and APs
...
Add DetectMicrocode() to load microcode on BSP and APs.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18002 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:40:41 +00:00
Jeff Fan
b4cd9f78ba
UefiCpuPkg/CpuMpPei: Sync BPS's mtrr setting to APs
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17999 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:39:24 +00:00
Jeff Fan
f8e4e86bc5
UefiCpuPkg/CpuMpPei: Sort APIC ID in ascending order
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17998 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:38:57 +00:00
Jeff Fan
7d51bf5c4e
UefiCpuPkg/CpuMpPei: Wakeup APs and collect AP count
...
BSP will send broadcast INIT Startup IPI to all APs and collect APs count and
BIST information.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17997 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:38:35 +00:00
Jeff Fan
e66d675de4
UefiCpuPkg/CpuMpPei: Prepare for buffer for AP wakeup and CPU MP data
...
Get AP wakeup buffer and copy AP reset code into it. Allocate APs' stack and CPU
MP data buffer. Fill CPU MP data fields accordingly.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17995 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:37:50 +00:00
Jeff Fan
05e107f8f2
UefiCpuPkg/CpuMpPei: Find available memory < 1MB for AP reset code
...
Search memory resource HOB list to find one available system memory under 1MB
for AP reset code and exchange information between BSP and APs.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17989 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:29:40 +00:00
Jeff Fan
f9d30595ae
UefiCpuPkg/CpuMpPei: Load GDT table on BSP
...
Load new GDT table and update segment accordingly.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17988 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:29:12 +00:00
Jeff Fan
65e79f931f
UefiCpuPkg: Add CpuMpPei module
...
This module is to provide MP PPI services defined in PI 1.4.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com >
Reviewed-by: Feng Tian <feng.tian@intel.com >
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17987 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15 03:28:04 +00:00