audk/UefiCpuPkg/Library/MpInitLib
Laszlo Ersek 6e1987f19a UefiCpuPkg/MpInitLib: wait no longer than necessary for initial AP startup
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-29 10:05:52 +01:00
..
Ia32 UefiCpuPkg/DxeMpLib: Remove unnecessary ret instruction 2016-11-28 08:57:09 +08:00
X64 UefiCpuPkg/DxeMpLib: Remove unnecessary ret instruction 2016-11-28 08:57:09 +08:00
DxeMpInitLib.inf UefiCpuPkg/DxeMpInitLib: remove duplicate HobLib class dependency 2016-11-17 10:57:33 +01:00
DxeMpInitLib.uni UefiCpuPkg/MpInitLib: Add two instances PeiMpInitLib and DxeMpInitLib 2016-08-17 19:58:07 +08:00
DxeMpLib.c UefiCpuPkg/DxeMpLib: Make sure APs in safe loop code 2016-11-28 08:56:40 +08:00
Microcode.c UefiCpuPkg/MpInitLib: Fix function header comments typo 2016-08-25 16:12:46 +08:00
MpLib.c UefiCpuPkg/MpInitLib: wait no longer than necessary for initial AP startup 2016-11-29 10:05:52 +01:00
MpLib.h UefiCpuPkg/DxeMpLib: Make sure APs in safe loop code 2016-11-28 08:56:40 +08:00
PeiMpInitLib.inf UefiCpuPkg/MpInitLib: Add MicrocodeDetect() and load microcode on BSP 2016-08-17 20:00:23 +08:00
PeiMpInitLib.uni UefiCpuPkg/MpInitLib: Add two instances PeiMpInitLib and DxeMpInitLib 2016-08-17 19:58:07 +08:00
PeiMpLib.c UefiCpuPkg/MpInitLib: Do not wakeup AP if only one processor supported 2016-11-09 16:01:13 +08:00