Commit Graph

205 Commits

Author SHA1 Message Date
Jeff Fan a51ee14463 UefiCpuPkg/Library/CpuExceptionHandlerLib: Add exception type decoder
Add exception type decoder to print exception name string beside print
exception type value. The exception names are from IA32 SDM.

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@17877 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08 05:45:10 +00:00
Hao Wu 274e843356 UefiCpuPkg S3Resume2Pei: Use safe string functions
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17744 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-30 06:30:44 +00:00
Jeff Fan 13181dde42 UefiCpuPkg/CpuDxe: NumberOfData is not BOOLEAN type
Should check NumberOfData value instead of treat its value as one BOOLEAN type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Shuming Qiu <shuming.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17672 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-19 08:27:35 +00:00
Jeff Fan db61e16308 UefiCpuPkg/CpuDxe: Get CPU BIST information from Guided HOB
Get CPU BIST information from gEfiSecPlatformInformation2PpiGuid or
gEfiSecPlatformInformationPpiGuid Guided HOB and update the CPU healthy status
for CPU MP Service.

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@17641 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-16 02:55:54 +00:00
Michael Kinney 087c67d0a0 UefiCpuPkg/CpuExceptionHandlerLib: Support IA32 processors without DE or FXSAVE/FXRESTOR
Use CPUID Leaf 01 to detect support for debug extensions and FXSAVE/FXRESTOR instructions.
Do not enable those features in CR4 if they are not supported.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>





git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17221 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-27 19:54:52 +00:00
Michael Kinney e9cd66d085 MdePkg/BaseXApicX2ApicLib: Support IA32 processors without MSR_IA32_APIC_BASE_ADDRESS
Use Family from CPUID 01 to detect support for the Local APIC Base Address MSR (MSR_IA32_APIC_BASE_ADDRESS).
If this MSR is not supported, then use Local APIC Base Address from the PCD PcdCpuLocalApicBaseAddress.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17217 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-27 19:48:00 +00:00
Michael Kinney 59d67246db MdePkg/BaseXApicLib: Support IA32 processors without MSR_IA32_APIC_BASE_ADDRESS
Use Family from CPUID 01 to detect support for the Local APIC Base Address MSR (MSR_IA32_APIC_BASE_ADDRESS).
If this MSR is not supported, then use Local APIC Base Address from the PCD PcdCpuLocalApicBaseAddress.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17216 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-27 19:47:26 +00:00
Scott Duplichan 718abab112 UefiCpuPkg: Avoid "error A2085" when DDK3790 tool chain is used
The DDK3790 tool chain fails when the PAUSE instruction is assembled:
error A2085: instruction or register not accepted in current CPU mode The solution is to use the .686 directive along with the .xmm directive.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17134 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-09 03:09:17 +00:00
Chen Fan 33f413f0d6 UefiCpuPkg/MpSerivce: add volatile qualifiers
For avoid the compiler optimizing the code, we let Parameter and Procedure in CpuData volatile.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17024 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-09 06:45:26 +00:00
Chen Fan 68f0674237 UefiCpuPkg/MpService: Put APs to sleep when not busy.
Add a new sleeping state for APs, when no procedure execution, put AP to sleep. when need to execute 
procedure, only need to wake up this AP by sent SIPI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17023 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-09 06:43:11 +00:00
Chen Fan e033a1a83e UefiCpuPkg/MpService: put AP to busy state when execution
CpuState should follow the process?

    Idle -> Ready -> Busy -> Finished
     ^                         |
     |                         |
     + - - - - - - - - - - - - +

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17022 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-09 06:38:16 +00:00
Chen Fan b302a9784c UefiCpuPkg/MpService: fix trivial typo in cpu state
CpuStateBuzy => CpuStateBusy

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17021 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-09 06:37:32 +00:00
Jordan Justen 3f3c4895da */Contributions.txt: Update example email address
Use the example.com domain as recommended in RFC 2606.

NOTE: This does not modify the wording of the "TianoCore Contribution
      Agreement 1.0" section

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Bruce Cran <bruce.cran@gmail.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16724 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-03 17:29:14 +00:00
Shumin Qiu c4bac158b3 Refine the format of PCD in INF files for UefiCpuPkg.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16617 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-16 05:20:31 +00:00
Jeff Fan e5030c1ec5 UefiCpuPkg CpuExceptionHandlerLib: Use %rax instead of %eax to make code consistence.
Make code consistence between ASM and S files.

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@16530 6f19259b-4bc3-4df7-8a09-765794883524
2014-12-17 05:30:33 +00:00
Jeff Fan 7475d13829 Add typecast to fix VS2005 build issue.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16419 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-24 04:57:40 +00:00
Jeff Fan 3a5d9a3682 UefiCpuPkg : Fix CpuDxe build issue with VS2005 tool chain
!!() cannot pass VS2005 build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16404 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-19 05:15:06 +00:00
Chen Fan 9840b1299d UefiCpuPkg/CpuDxe: Put APs in wait for SIPI state at ExitBootServices
when gBS->ExitBootServices() is called, the APs should avoid to access
the unsafed buff datas which were allocated by boot services.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16397 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-17 14:54:09 +00:00
Chen Fan 4a50c27285 UefiCpuPkg/CpuDxe: install Mp Service protocol
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16371 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:30:18 +00:00
Jordan Justen dee9376ffc UefiCpuPkg/CpuDxe: Startup APs
This sequence should happen:
* CpuMp.c: Allocate a stack for the APs
* ApStartup.c: Send Start IPI to wake APs in 16-bit real mode
* MpAsm.S: AP enters CpuDxe driver code without stack
  - AP grabs a lock
  - AP sets up stack
  - AP calls CpuMp.c:ApEntryPointInC

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16370 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:30:09 +00:00
Chen Fan cd8c700b03 UefiCpuPkg/MpService: avoid dead lock caused by CheckAllAPsStatus
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16369 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:54 +00:00
Chen Fan 0e724fc198 UefiCpuPkg/MpService: avoid reset AP still hold a lock
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16368 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:40 +00:00
Chen Fan 232eb4c826 UefiCpuPkg/MpService: free the unused cpu data buffer
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16367 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:31 +00:00
Chen Fan ac9dbb3b03 UefiCpuPkg/CpuDxe: introduce ResetApStackless()
If timeout expires before AP returns from Procedure, the AP should
be terminated, we introduce ResetApStackLess() to send init IPI
to let AP exit Procedurce and re-available.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16366 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:13 +00:00
Chen Fan fe078dd57f UefiCpuPkg/CpuDxe: split out StartupCode from StartApsStackless()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16365 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:01 +00:00
Chen Fan e4aaf76428 UefiCpuPkg/MpService: avoid next timer getting into CheckAllAPsStatus()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16364 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:28:48 +00:00
Chen Fan d16cf36d2a UefiCpuPkg/MpService: Simply Lock usage
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16363 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:28:33 +00:00
Chen Fan acb2172d15 UefiCpuPkg/MpService: move settimer out to InitMpSystemData
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16362 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:28:20 +00:00
Chen Fan 9908a829d0 UefiCpuPkg/CpuDxe: Ap do loop routine to execute procedure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16361 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:28:10 +00:00
Chen Fan b7c05ba517 UefiCpuPkg/CpuDxe: implement Mp Services:SwitchBSP()
by now, SwitchBSP() always return UNSUPPORTED

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16360 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:27:52 +00:00
Chen Fan 5fee172fb7 UefiCpuPkg/CpuDxe: implement Mp Services:StartupAllAPs()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16359 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:27:34 +00:00
Chen Fan 3f4f0af872 UefiCpuPkg/CpuDxe: implement Mp Protocol:StartupThisAP()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16358 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:27:21 +00:00
Chen Fan fa7ce675b9 UefiCpuPkg/CpuDxe: implement Mp Protocol:EnableDisableAP()
Due to the implementation of  AcquireSpinLock() is not MP safe,
so we should use AcquireSpinLockOrFail directly instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16357 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:27:09 +00:00
Chen Fan e7938b5a86 UefiCpuPkg/CpuDxe: implement Mp Services:GetProcessorInfo()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16356 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:53 +00:00
Chen Fan d894d8b704 UefiCpuPkg/CpuDxe: implement Mp Protocol:GetNumberOfProcessors()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16355 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:42 +00:00
Chen Fan cfa2fac1f6 UefiCpuPkg/CpuDxe: implement Mp Protocol: WhoAmI()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16354 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:32 +00:00
Chen Fan 03673ae11e UefiCpuPkg/CpuDxe: introduce MP_SYSTEM_DATA for Mp Service Protocol
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16353 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:23 +00:00
Chen Fan 003973d98c UefiCpuPkg/CpuDxe: introduce EFI_MP_SERVICES_PROTOCOL
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16352 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:13 +00:00
Chen Fan e343f8f7b3 UefiCpuPkg/CpuDxe: Switch Ap Stack to NewStack
All APs use the same common stack to initialization. after
initialization, APs should switch to the stack of its own.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16351 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:03 +00:00
Chen Fan 6a26a597a3 UefiCpuPkg/CpuDxe: introduce two PCD value
introduce PCD value: PcdCpuMaxLogicalProcessorNumber and PcdCpuApStackSize,
used for initialize APs stacks.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16350 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:25:48 +00:00
Jordan Justen 533263ee5a UefiCpuPkg/CpuDxe: Add StartApsStackless routine
This routine starts the APs and directs them to run the specified
code.

The specified code is entered without a stack being available.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16349 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:25:29 +00:00
Jordan Justen a1e8986d97 UefiCpuPkg/CpuDxe: Move GDT structures into CpuGdt.h
We'll want to use the structures for AP startup.

Note: It seems previously we were not using '#pragma pack ()' in
      CpuGdt.c.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16348 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:25:10 +00:00
Jordan Justen fab82c1873 UefiCpuPkg/CpuDxe: Add stackless assembly AP entry points
The AP startup code simply jumps into this code with the CpuDxe driver
without setting up a stack for the processor.

Therefore, this code must setup the stack before calling into C code.

This is the basic flow:
* AP enters CpuDxe driver code (AsmApEntryPoint) without stack
  - AP grabs a lock
  - AP sets up stack
  - AP calls CpuMp.c:ApEntryPointInC
  - If ApEntryPointInC returns, the lock is freed, and another AP may
    run
  - The AP C code may call AsmApDoneWithCommonStack to indicate that
    the AP is no longer using the stack, and another may therefore
    proceed to use the stack and then call ApEntryPointInC

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16347 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:24:59 +00:00
Jordan Justen 1535c888c6 UefiCpuPkg/CpuDxe: Add ApEntryPointInC
This is the function the AP assembly code will expect to call after
getting a lock and setting up the stack.

Only one AP will enter this routine at a time.

If ApEntryPointInC exits, then the assembly code will loop around to
grab the lock, setup the stack, and call ApEntryPointInC again.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16346 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:24:43 +00:00
Jordan Justen 6022e28cf7 UefiCpuPkg/CpuDxe: Add no-op InitializeMpSupport
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16345 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:24:25 +00:00
Jeff Fan 8fd82c235d Remove un-used PPI reference.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>







git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16303 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-06 06:13:22 +00:00
Jordan Justen 26830e8579 EDK II Contributions.txt: Update patch format information
Update to show what the patch looks like in email form.

NOTE: This does not modify the wording of the "TianoCore Contribution
      Agreement 1.0" section

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16297 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-31 22:05:50 +00:00
Nikolai Saoukh 010f55d3fb UefiCpuPkg: error: invalid instruction mnemonic 'retf'
.S assembler files must be AT&T syntax ones. So Intel syntax mnemonic is not good. Discovered by clang integrated assembler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nikolai Saoukh <nms@otdel-1.org>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16100 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-12 08:38:23 +00:00
Nikolai Saoukh b6341b2698 UefiCpuPkg: error: invalid instruction mnemonic 'retf'
.S assembler files must be AT&T syntax ones. So Intel syntax mnemonic is not good. Discovered by clang integrated assembler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nikolai Saoukh <nms@otdel-1.org>
Reviewed-by: Andrew Fish <afish@apple.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16098 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-12 02:59:34 +00:00
Anderw Fish 07da1ac8c4 UefiCpuPkg: CpuExceptionHandlerLib: Make self modifying code work with Xcode
CpuExceptionHandlerLib has code that contains absolute relocations, not supported by
Xcode for X64, and it then copies this code to an alternate location in memory. It is 
very hard to write IP relative self-modifiying code. I had to update AsmVectorNumFixup()
to also patch in the absolute addressess after the code was copied. 
 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Anderw Fish <afish@apple.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16068 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-09 06:50:51 +00:00