public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jeff Fan <jeff.fan@intel.com>
To: edk2-devel@ml01.01.org
Subject: [Patch v4 00/46] MP Initialize Library
Date: Sat, 30 Jul 2016 02:14:26 +0800	[thread overview]
Message-ID: <1469816112-8200-1-git-send-email-jeff.fan@intel.com> (raw)

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. I have tested Ovmf platform and have not tested Quark yet.

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/MpInitLibV4 for review.

Jeff Fan (46):
  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 ApCFunction() 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
  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

 MdePkg/Include/Protocol/MpService.h                |  490 ++---
 OvmfPkg/OvmfPkgIa32.dsc                            |    2 +
 OvmfPkg/OvmfPkgIa32X64.dsc                         |    2 +
 OvmfPkg/OvmfPkgX64.dsc                             |    2 +
 QuarkPlatformPkg/Quark.dsc                         |    1 +
 QuarkPlatformPkg/QuarkMin.dsc                      |    3 +-
 UefiCpuPkg/CpuDxe/ApStartup.c                      |  478 -----
 UefiCpuPkg/CpuDxe/CpuDxe.c                         |   17 +-
 UefiCpuPkg/CpuDxe/CpuDxe.h                         |   13 +-
 UefiCpuPkg/CpuDxe/CpuDxe.inf                       |   12 +-
 UefiCpuPkg/CpuDxe/CpuDxe.uni                       |   10 +-
 UefiCpuPkg/CpuDxe/CpuDxeExtra.uni                  |    4 +-
 UefiCpuPkg/CpuDxe/CpuMp.c                          | 1302 +------------
 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            |  646 +++++++
 .../{CpuMpPei => Library/MpInitLib}/Ia32/MpEqu.inc |    4 +-
 .../MpInitLib}/Ia32/MpFuncs.nasm                   |   66 +-
 .../{CpuMpPei => Library/MpInitLib}/Microcode.c    |   77 +-
 UefiCpuPkg/Library/MpInitLib/MpLib.c               | 2018 ++++++++++++++++++++
 UefiCpuPkg/Library/MpInitLib/MpLib.h               |  529 +++++
 .../MpInitLib/PeiMpInitLib.inf}                    |   60 +-
 .../MpInitLib/PeiMpInitLib.uni}                    |   12 +-
 UefiCpuPkg/Library/MpInitLib/PeiMpLib.c            |  640 +++++++
 .../{CpuMpPei => Library/MpInitLib}/X64/MpEqu.inc  |    6 +-
 .../MpInitLib}/X64/MpFuncs.nasm                    |   84 +-
 UefiCpuPkg/UefiCpuPkg.dec                          |    4 +
 UefiCpuPkg/UefiCpuPkg.dsc                          |    5 +-
 49 files changed, 5744 insertions(+), 5645 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



             reply	other threads:[~2016-07-29 18:15 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469816112-8200-1-git-send-email-jeff.fan@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox