public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch v5 00/48] MP Initialize Library
@ 2016-08-02  8:59 Jeff Fan
  2016-08-02  8:59 ` [Patch v5 01/48] UefiCpuPkg/LocalApic.h: Remove duplicated/conflicted definitions Jeff Fan
                   ` (48 more replies)
  0 siblings, 49 replies; 71+ messages in thread
From: Jeff Fan @ 2016-08-02  8:59 UTC (permalink / raw)
  To: edk2-devel

We add MP Initialize Library defined in UefiCpuPkg/Include/Library/MpInitLib.h.
It will provide basic functionalities of MP services and could be consumed by
CPU MP PEI and CPU MP DXE to produce CPU MP PPI and CPU MP Protocol. Then most
of code could be shared between PEI and DXE modules.

PeiMpInitLib and DxeMpInitLib are added to make the CpuMpPei and CpuDxe more
simply.

I also updated the Ovmf Platform and Quark platform to consume MP Initialize 
library. 

Thanks Laszlo to verify on OVMF and Mike to verify on Quark.

v5:
  1. Update Patches #1, #5, #10 - #12, #14, #16 - #18, #20, #21, #28, #29, #37,
                    #43.
  2. Add Patches #44, #48
  (Please see the patches commit log for more details)

v4:
  1. Update Patches #2 - #6, #10, #15, #28, #30, #31, #33, #34, #38, #41, #43.
  2. Add Patches #7, #8, #42, #44 - #46.
  3. Add Reviewed-by: Laszlo Ersek <lersek@redhat.com> on Patches #1, #2.
  (Please see the patches commit log for more details)
  
v3:
  1. Update Patch #2, #4 - #8, #28, #33, #36, #38 per Giri's comments to
     a. Update SDM date to June, 2016
     b. Mention BCD format in CPU_MICROCODE_DATE
     c. Rename ProcessorChecksum to Checksum to match SDM.
     d. Add whitespace after MpInitLibInitialize
     e. Rename MpInitLibSwitchBsp to MpInitLibSwitchBSP to match PI spec.
     f. Rename NumApsExecutingLoction to NumApsExecutingLocation
     g. Add whitespace after ; in .nasm file
     h. Rename *RellocateAp* to *RelocateAp*
  2. Update Patch #16, #17, #29-#32 to
     a. Use CamelCase for mStopCheckAllApsStatus and CheckAndUpdateApsStatus().
  3. Update Patch #36 and #39 to
     a. Add PeiMpInitLib instance in UefiCpuPkg.dsc
     b. Add DxeMpInitLib instance in UefiCpuPkg.dsc
  4. Update Patch #39 and #40 to 
     a. move the code of consuming MP Initialize library from patch #40 to
     patch #39.
  5. Update Patch #1, #3 - #8, #16 to
     a. Add Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> 

I fork the whole tree with the updated v3 patches
at https://github.com/vanjeff/edk2/tree/MpInitLibV5 for review.


Jeff Fan (48):
  UefiCpuPkg/LocalApic.h: Remove duplicated/conflicted definitions
  UefiCpuPkg/MpInitLib: Add microcode definitions defined in IA32 SDM
  UefiCpuPkg/CpuS3DataDxe: Move StartupVector allocation to EndOfDxe()
  UefiCpuPkg/MpInitLib: Add MP Initialize library class definition
  UefiCpuPkg/MpInitLib: Add two instances PeiMpInitLib and DxeMpInitLib
  UefiCpuPkg/MpInitLib: Add AP assembly code and MP_CPU_EXCHANGE_INFO
  UefiCpuPkg/MpInitLib: Fix typo and clean up the code
  UefiCpuPkg/MpInitLib: Add EnableExecuteDisable in MP_CPU_EXCHANGE_INFO
  UefiCpuPkg/MpInitLib: Add AsmRelocateApLoop() assembly code
  UefiCpuPkg/MpInitLib: Add MP_ASSEMBLY_ADDRESS_MAP
  UefiCpuPkg/MpInitLib: Get ApLoopMode and MointorFilter size
  UefiCpuPkg/MpInitLib: Allocate and initialize memory of MP Data buffer
  UefiCpuPkg/MpInitLib: Initialize CPU_AP_DATA for CPU APs
  UefiCpuPkg/MpInitLib: Add CPU_VOLATILE_REGISTERS & worker functions
  UefiCpuPkg/MpInitLib: Add MicrocodeDetect() and load microcode on BSP
  UefiCpuPkg/MpInitLib: Save CPU MP Data pointer
  UefiCpuPkg/MpInitLib: Register one End of PEI callback function
  UefiCpuPkg/MpInitLib: Register one period event to check APs status
  UefiCpuPkg/MpInitLib: Allocate AP reset vector buffer under 1MB
  UefiCpuPkg/MpInitLib: Add ApWakeupFunction() executed by assembly code
  UefiCpuPkg/MpInitLib: Fill MP_CPU_EXCHANGE_INFO fields
  UefiCpuPkg/MpInitLib: Add WakeUpAP()
  UefiCpuPkg/MpInitLib: Send INIT-SIPI-SIPI to get processor count
  UefiCpuPkg/MpInitLib: Enable x2APIC mode on BSP/APs
  UefiCpuPkg/MpInitLib: Sort processor by ascending order of APIC ID
  UefiCpuPkg/MpInitLib: Skip collect processor count if GUIDed HOB exist
  UefiCpuPkg/MpInitLib: Implementation of
    MpInitLibGetNumberOfProcessors()
  UefiCpuPkg/MpInitLib: Implementation of MpInitLibGetProcessorInfo()
  UefiCpuPkg/MpInitLib: Implementation of MpInitLibWhoAmI()
  UefiCpuPkg/MpInitLib: Implementation of MpInitLibSwitchBSP()
  UefiCpuPkg/MpInitLib: Implementation of MpInitLibEnableDisableAP()
  UefiCpuPkg/MpInitLib: Check APs Status and update APs status
  UefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupThisAP()
  UefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupAllAPs()
  UefiCpuPkg/MpInitLib: Place APs in safe loop before hand-off to OS
  OvmfPkg: Add MpInitLib reference in DSC files.
  QuarkPlatformPkg: Add MpInitLib reference in DSC files.
  UefiCpuPkg/CpuMpPei: Consume MpInitLib to produce CPU MP PPI services
  UefiCpuPkg/CpuMpPei: Remove unused files and codes
  UefiCpuPkg/CpuMpPei: Delete PeiMpServices.c and PeiMpServices.h
  UefiCpuPkg/CpuDxe: Consume MpInitLib to produce CPU MP Protocol
    services
  UefiCpuPkg/CpuDxe: Move SetMtrrsFromBuffer() location.
  UefiCpuPkg/CpuDxe: Remove unused codes and files
  UefiCpuPkg/CpuDxe: Remove PcdCpuMaxLogicalProcessorNumber consuming
  MdePkg/MpService.h: Fixed typo in function header to match PI spec
  MdePkg/MpService.h: Trim whitespace at end of line
  UefiCpuPkg/CpuDxe: Fixed typo in function header to match PI spec
  UefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVariableArchProtocolGuid dependency

 MdePkg/Include/Protocol/MpService.h                |  490 ++---
 OvmfPkg/OvmfPkgIa32.dsc                            |    2 +
 OvmfPkg/OvmfPkgIa32X64.dsc                         |    2 +
 OvmfPkg/OvmfPkgX64.dsc                             |    2 +
 QuarkPlatformPkg/Quark.dsc                         |    2 +
 QuarkPlatformPkg/QuarkMin.dsc                      |    4 +-
 .../DebugAgent/DebugAgentCommon/DebugAgent.h       |    1 +
 .../Library/DebugAgent/DebugAgentCommon/DebugMp.c  |    5 +-
 UefiCpuPkg/CpuDxe/ApStartup.c                      |  478 -----
 UefiCpuPkg/CpuDxe/CpuDxe.c                         |   17 +-
 UefiCpuPkg/CpuDxe/CpuDxe.h                         |   13 +-
 UefiCpuPkg/CpuDxe/CpuDxe.inf                       |   17 +-
 UefiCpuPkg/CpuDxe/CpuDxe.uni                       |   10 +-
 UefiCpuPkg/CpuDxe/CpuDxeExtra.uni                  |    4 +-
 UefiCpuPkg/CpuDxe/CpuMp.c                          | 1306 +------------
 UefiCpuPkg/CpuDxe/CpuMp.h                          |  186 +-
 UefiCpuPkg/CpuDxe/Ia32/MpAsm.asm                   |   76 -
 UefiCpuPkg/CpuDxe/Ia32/MpAsm.nasm                  |   68 -
 UefiCpuPkg/CpuDxe/X64/MpAsm.asm                    |   76 -
 UefiCpuPkg/CpuDxe/X64/MpAsm.nasm                   |   70 -
 UefiCpuPkg/CpuMpPei/CpuBist.c                      |   53 +-
 UefiCpuPkg/CpuMpPei/CpuMpPei.c                     | 1118 ++++-------
 UefiCpuPkg/CpuMpPei/CpuMpPei.h                     |  515 ++---
 UefiCpuPkg/CpuMpPei/CpuMpPei.inf                   |   32 +-
 UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm               |  250 ---
 UefiCpuPkg/CpuMpPei/Microcode.h                    |   58 -
 UefiCpuPkg/CpuMpPei/PeiMpServices.c                |  956 ----------
 UefiCpuPkg/CpuMpPei/PeiMpServices.h                |  377 ----
 UefiCpuPkg/CpuMpPei/X64/MpFuncs.asm                |  290 ---
 UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c                |   42 +-
 UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf           |    2 +-
 UefiCpuPkg/Include/Library/MpInitLib.h             |  353 ++++
 UefiCpuPkg/Include/Register/LocalApic.h            |   20 +-
 UefiCpuPkg/Include/Register/Microcode.h            |  200 ++
 UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c     |   29 +-
 .../BaseXApicX2ApicLib/BaseXApicX2ApicLib.c        |   51 +-
 .../MpInitLib/DxeMpInitLib.inf}                    |   68 +-
 .../MpInitLib/DxeMpInitLib.uni}                    |   12 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c            |  649 +++++++
 .../{CpuMpPei => Library/MpInitLib}/Ia32/MpEqu.inc |    4 +-
 .../MpInitLib}/Ia32/MpFuncs.nasm                   |   66 +-
 .../{CpuMpPei => Library/MpInitLib}/Microcode.c    |   77 +-
 UefiCpuPkg/Library/MpInitLib/MpLib.c               | 2013 ++++++++++++++++++++
 UefiCpuPkg/Library/MpInitLib/MpLib.h               |  554 ++++++
 .../MpInitLib/PeiMpInitLib.inf}                    |   60 +-
 .../MpInitLib/PeiMpInitLib.uni}                    |   12 +-
 UefiCpuPkg/Library/MpInitLib/PeiMpLib.c            |  643 +++++++
 .../{CpuMpPei => Library/MpInitLib}/X64/MpEqu.inc  |    6 +-
 .../MpInitLib}/X64/MpFuncs.nasm                    |   84 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf       |    4 +-
 UefiCpuPkg/UefiCpuPkg.dec                          |    4 +
 UefiCpuPkg/UefiCpuPkg.dsc                          |    4 +
 52 files changed, 5777 insertions(+), 5658 deletions(-)
 delete mode 100644 UefiCpuPkg/CpuDxe/ApStartup.c
 delete mode 100644 UefiCpuPkg/CpuDxe/Ia32/MpAsm.asm
 delete mode 100644 UefiCpuPkg/CpuDxe/Ia32/MpAsm.nasm
 delete mode 100644 UefiCpuPkg/CpuDxe/X64/MpAsm.asm
 delete mode 100644 UefiCpuPkg/CpuDxe/X64/MpAsm.nasm
 delete mode 100644 UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.asm
 delete mode 100644 UefiCpuPkg/CpuMpPei/Microcode.h
 delete mode 100644 UefiCpuPkg/CpuMpPei/PeiMpServices.c
 delete mode 100644 UefiCpuPkg/CpuMpPei/PeiMpServices.h
 delete mode 100644 UefiCpuPkg/CpuMpPei/X64/MpFuncs.asm
 create mode 100644 UefiCpuPkg/Include/Library/MpInitLib.h
 create mode 100644 UefiCpuPkg/Include/Register/Microcode.h
 copy UefiCpuPkg/{CpuMpPei/CpuMpPei.inf => Library/MpInitLib/DxeMpInitLib.inf} (52%)
 copy UefiCpuPkg/{CpuDxe/CpuDxeExtra.uni => Library/MpInitLib/DxeMpInitLib.uni} (53%)
 create mode 100644 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
 rename UefiCpuPkg/{CpuMpPei => Library/MpInitLib}/Ia32/MpEqu.inc (88%)
 rename UefiCpuPkg/{CpuMpPei => Library/MpInitLib}/Ia32/MpFuncs.nasm (77%)
 rename UefiCpuPkg/{CpuMpPei => Library/MpInitLib}/Microcode.c (68%)
 create mode 100644 UefiCpuPkg/Library/MpInitLib/MpLib.c
 create mode 100644 UefiCpuPkg/Library/MpInitLib/MpLib.h
 copy UefiCpuPkg/{CpuMpPei/CpuMpPei.inf => Library/MpInitLib/PeiMpInitLib.inf} (58%)
 copy UefiCpuPkg/{CpuDxe/CpuDxeExtra.uni => Library/MpInitLib/PeiMpInitLib.uni} (53%)
 create mode 100644 UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
 rename UefiCpuPkg/{CpuMpPei => Library/MpInitLib}/X64/MpEqu.inc (88%)
 rename UefiCpuPkg/{CpuMpPei => Library/MpInitLib}/X64/MpFuncs.nasm (73%)

-- 
2.7.4.windows.1



^ permalink raw reply	[flat|nested] 71+ messages in thread

end of thread, other threads:[~2016-09-02  0:49 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02  8:59 [Patch v5 00/48] MP Initialize Library Jeff Fan
2016-08-02  8:59 ` [Patch v5 01/48] UefiCpuPkg/LocalApic.h: Remove duplicated/conflicted definitions Jeff Fan
2016-08-02 17:17   ` Kinney, Michael D
2016-08-02  8:59 ` [Patch v5 02/48] UefiCpuPkg/MpInitLib: Add microcode definitions defined in IA32 SDM Jeff Fan
2016-08-02 15:20   ` Mudusuru, Giri P
2016-08-02  8:59 ` [Patch v5 03/48] UefiCpuPkg/CpuS3DataDxe: Move StartupVector allocation to EndOfDxe() Jeff Fan
2016-08-02  8:59 ` [Patch v5 04/48] UefiCpuPkg/MpInitLib: Add MP Initialize library class definition Jeff Fan
2016-08-02  8:59 ` [Patch v5 05/48] UefiCpuPkg/MpInitLib: Add two instances PeiMpInitLib and DxeMpInitLib Jeff Fan
2016-08-02  8:59 ` [Patch v5 06/48] UefiCpuPkg/MpInitLib: Add AP assembly code and MP_CPU_EXCHANGE_INFO Jeff Fan
2016-08-02  8:59 ` [Patch v5 07/48] UefiCpuPkg/MpInitLib: Fix typo and clean up the code Jeff Fan
2016-08-02  8:59 ` [Patch v5 08/48] UefiCpuPkg/MpInitLib: Add EnableExecuteDisable in MP_CPU_EXCHANGE_INFO Jeff Fan
2016-08-02  8:59 ` [Patch v5 09/48] UefiCpuPkg/MpInitLib: Add AsmRelocateApLoop() assembly code Jeff Fan
2016-08-02  8:59 ` [Patch v5 10/48] UefiCpuPkg/MpInitLib: Add MP_ASSEMBLY_ADDRESS_MAP Jeff Fan
2016-08-02  8:59 ` [Patch v5 11/48] UefiCpuPkg/MpInitLib: Get ApLoopMode and MointorFilter size Jeff Fan
2016-08-02  8:59 ` [Patch v5 12/48] UefiCpuPkg/MpInitLib: Allocate and initialize memory of MP Data buffer Jeff Fan
2016-08-02  8:59 ` [Patch v5 13/48] UefiCpuPkg/MpInitLib: Initialize CPU_AP_DATA for CPU APs Jeff Fan
2016-08-02  8:59 ` [Patch v5 14/48] UefiCpuPkg/MpInitLib: Add CPU_VOLATILE_REGISTERS & worker functions Jeff Fan
2016-08-02  8:59 ` [Patch v5 15/48] UefiCpuPkg/MpInitLib: Add MicrocodeDetect() and load microcode on BSP Jeff Fan
2016-08-02  8:59 ` [Patch v5 16/48] UefiCpuPkg/MpInitLib: Save CPU MP Data pointer Jeff Fan
2016-08-02  8:59 ` [Patch v5 17/48] UefiCpuPkg/MpInitLib: Register one End of PEI callback function Jeff Fan
2016-08-02  8:59 ` [Patch v5 18/48] UefiCpuPkg/MpInitLib: Register one period event to check APs status Jeff Fan
2016-08-02  8:59 ` [Patch v5 19/48] UefiCpuPkg/MpInitLib: Allocate AP reset vector buffer under 1MB Jeff Fan
2016-08-02  8:59 ` [Patch v5 20/48] UefiCpuPkg/MpInitLib: Add ApWakeupFunction() executed by assembly code Jeff Fan
2016-08-02  8:59 ` [Patch v5 21/48] UefiCpuPkg/MpInitLib: Fill MP_CPU_EXCHANGE_INFO fields Jeff Fan
2016-08-02  8:59 ` [Patch v5 22/48] UefiCpuPkg/MpInitLib: Add WakeUpAP() Jeff Fan
2016-08-02  8:59 ` [Patch v5 23/48] UefiCpuPkg/MpInitLib: Send INIT-SIPI-SIPI to get processor count Jeff Fan
2016-08-02  8:59 ` [Patch v5 24/48] UefiCpuPkg/MpInitLib: Enable x2APIC mode on BSP/APs Jeff Fan
2016-08-02  8:59 ` [Patch v5 25/48] UefiCpuPkg/MpInitLib: Sort processor by ascending order of APIC ID Jeff Fan
2016-08-02  8:59 ` [Patch v5 26/48] UefiCpuPkg/MpInitLib: Skip collect processor count if GUIDed HOB exist Jeff Fan
2016-08-02  8:59 ` [Patch v5 27/48] UefiCpuPkg/MpInitLib: Implementation of MpInitLibGetNumberOfProcessors() Jeff Fan
2016-08-02  8:59 ` [Patch v5 28/48] UefiCpuPkg/MpInitLib: Implementation of MpInitLibGetProcessorInfo() Jeff Fan
2016-08-02  8:59 ` [Patch v5 29/48] UefiCpuPkg/MpInitLib: Implementation of MpInitLibWhoAmI() Jeff Fan
2016-08-02  8:59 ` [Patch v5 30/48] UefiCpuPkg/MpInitLib: Implementation of MpInitLibSwitchBSP() Jeff Fan
2016-08-02  8:59 ` [Patch v5 31/48] UefiCpuPkg/MpInitLib: Implementation of MpInitLibEnableDisableAP() Jeff Fan
2016-08-02  8:59 ` [Patch v5 32/48] UefiCpuPkg/MpInitLib: Check APs Status and update APs status Jeff Fan
2016-08-02  8:59 ` [Patch v5 33/48] UefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupThisAP() Jeff Fan
2016-08-02  8:59 ` [Patch v5 34/48] UefiCpuPkg/MpInitLib: Implementation of MpInitLibStartupAllAPs() Jeff Fan
2016-08-02  8:59 ` [Patch v5 35/48] UefiCpuPkg/MpInitLib: Place APs in safe loop before hand-off to OS Jeff Fan
2016-08-02  8:59 ` [Patch v5 36/48] OvmfPkg: Add MpInitLib reference in DSC files Jeff Fan
2016-08-02 11:39   ` Laszlo Ersek
2016-08-02  8:59 ` [Patch v5 37/48] QuarkPlatformPkg: " Jeff Fan
2016-08-02  8:59 ` [Patch v5 38/48] UefiCpuPkg/CpuMpPei: Consume MpInitLib to produce CPU MP PPI services Jeff Fan
2016-08-02  8:59 ` [Patch v5 39/48] UefiCpuPkg/CpuMpPei: Remove unused files and codes Jeff Fan
2016-08-02  8:59 ` [Patch v5 40/48] UefiCpuPkg/CpuMpPei: Delete PeiMpServices.c and PeiMpServices.h Jeff Fan
2016-08-02  8:59 ` [Patch v5 41/48] UefiCpuPkg/CpuDxe: Consume MpInitLib to produce CPU MP Protocol services Jeff Fan
2016-08-02  8:59 ` [Patch v5 42/48] UefiCpuPkg/CpuDxe: Move SetMtrrsFromBuffer() location Jeff Fan
2016-08-02  8:59 ` [Patch v5 43/48] UefiCpuPkg/CpuDxe: Remove unused codes and files Jeff Fan
2016-08-02  8:59 ` [Patch v5 44/48] UefiCpuPkg/CpuDxe: Remove PcdCpuMaxLogicalProcessorNumber consuming Jeff Fan
2016-08-02  8:59 ` [Patch v5 45/48] MdePkg/MpService.h: Fixed typo in function header to match PI spec Jeff Fan
2016-08-02  8:59 ` [Patch v5 46/48] MdePkg/MpService.h: Trim whitespace at end of line Jeff Fan
2016-08-02  8:59 ` [Patch v5 47/48] UefiCpuPkg/CpuDxe: Fixed typo in function header to match PI spec Jeff Fan
2016-08-02  8:59 ` [Patch v5 48/48] UefiCpuPkg/PiSmmCpuDxeSmm: Add gEfiVariableArchProtocolGuid dependency Jeff Fan
2016-08-19  1:19   ` Laszlo Ersek
2016-08-19  2:00     ` Fan, Jeff
2016-08-19  2:26       ` Laszlo Ersek
2016-08-19  2:45         ` Zeng, Star
2016-08-19  2:57           ` Zeng, Star
2016-08-19 13:19             ` Laszlo Ersek
2016-08-23 15:33             ` Laszlo Ersek
2016-08-24  2:39               ` Zeng, Star
2016-08-24  3:27                 ` Laszlo Ersek
     [not found]                   ` <ea6bfac6-1f9c-a0f6-c4ce-0b147136f34e@intel.com>
2016-08-24  8:16                     ` Zeng, Star
2016-08-24 11:53                     ` Laszlo Ersek
2016-08-24 13:42                       ` Zeng, Star
2016-08-25  8:00                         ` Fan, Jeff
2016-08-30 13:45                           ` Laszlo Ersek
2016-09-01  1:11                             ` Fan, Jeff
2016-09-01 17:46                               ` Laszlo Ersek
2016-09-02  0:49                                 ` Fan, Jeff
2016-08-19 14:28         ` Laszlo Ersek
2016-08-02 18:55 ` [Patch v5 00/48] MP Initialize Library Kinney, Michael D

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox