audk/UefiCpuPkg/Library
Ray Ni 793c59da13 UefiCpuPkg/CpuFeature: reduce time complexty to calc CpuInfo.First
CpuInfo.First stores whether the current thread belongs to the first
package in the platform, first core in a package, first thread in a
core.

But the time complexity of original algorithm to calculate the
CpuInfo.First is O (n) * O (p) * O (c).
  n: number of processors
  p: number of packages
  c: number of cores per package

The patch trades time with space by storing the first package, first
core per package, first thread per core in an array.
The time complexity becomes O (n).

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Yun Lou <yun.lou@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
2020-12-14 08:54:22 +00:00
..
BaseUefiCpuLib UefiCpuPkg: Move StandardSignatureIsAuthenticAMD to BaseUefiCpuLib 2020-07-07 23:25:16 +00:00
BaseXApicLib UefiCpuPkg: Move StandardSignatureIsAuthenticAMD to BaseUefiCpuLib 2020-07-07 23:25:16 +00:00
BaseXApicX2ApicLib UefiCpuPkg: Move StandardSignatureIsAuthenticAMD to BaseUefiCpuLib 2020-07-07 23:25:16 +00:00
CpuCommonFeaturesLib UefiCpuPkg/CpuCommonFeaturesLib: Fix spelling mistake 2020-08-03 16:31:36 +00:00
CpuExceptionHandlerLib UefiCpuPkg/CpuExceptionHandler: Add base support for the #VC exception 2020-08-17 02:46:39 +00:00
CpuTimerLib UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf 2019-08-21 21:36:56 +08:00
MpInitLib UefiCpuPkg/MpInitLib: For SEV-ES guest, set stack based on processor number 2020-11-10 19:07:55 +00:00
MpInitLibUp UefiCpuPkg/MpInitLibUp: Add MpInitLibStartupAllCPUs API. 2019-07-29 09:25:20 +08:00
MtrrLib UefiCpuPkg/MtrrLibUnitTest: Change to use static array for CI test 2020-08-12 11:38:37 +00:00
PlatformSecLibNull UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
RegisterCpuFeaturesLib UefiCpuPkg/CpuFeature: reduce time complexty to calc CpuInfo.First 2020-12-14 08:54:22 +00:00
SecPeiDxeTimerLibUefiCpu UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
SmmCpuFeaturesLib UefiCpuPkg/SmmCpuFeaturesLib: Add Tiger Lake support 2020-12-08 23:07:22 +00:00
SmmCpuPlatformHookLibNull UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
VmgExitLibNull UefiCpuPkg, OvmfPkg: Disable interrupts when using the GHCB 2020-11-10 19:07:55 +00:00