On 2/22/24 17:01, Gerd Hoffmann wrote:
> Needed to boot guests with thousands of vcpus.
>
> v3:
>  - refine comments and commit messages.
>  - fix MaxCpusPerHob calculation.
>  - pick up review tags.
>  - add patch to speed up GetBspNumber a bit.
> v2:
>  - rework HOB loops for better performance: O(n) instead of O(n^2).
>
> Gerd Hoffmann (6):
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetMpHandOffHob
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
>     SwitchApContext()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
>     MpInitLibInitialize
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()
>   UefiCpuPkg/MpInitLib: return early in GetBspNumber()
>
>  UefiCpuPkg/Library/MpInitLib/MpLib.h    |  14 ++-
>  UefiCpuPkg/Library/MpInitLib/MpLib.c    | 157 +++++++++++++++---------
>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c |  44 ++++---
>  3 files changed, 142 insertions(+), 73 deletions(-)
>

BTW, differences in PR#5410 relative to v3 as posted:

1:  678ed78d24a3 ! 1:  ecd6c4bb3396 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to GetMpHandOffHob
    @@ Commit message

         Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
         Message-Id: <20240222160106.686484-2-kra...@redhat.com>
    +    Reviewed-by: Ray Ni <ray...@intel.com>
    +    Reviewed-by: Laszlo Ersek <ler...@redhat.com>

      ## UefiCpuPkg/Library/MpInitLib/MpLib.h ##
     @@ UefiCpuPkg/Library/MpInitLib/MpLib.h: SwitchApContext (
2:  23b3e66f9935 = 2:  189467980103 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to GetBspNumber()
3:  e712d36775d0 = 3:  8ab0f63c0f04 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to SwitchApContext()
4:  9a81417f4b76 ! 4:  995a8ace7801 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to MpInitLibInitialize
    @@ Commit message
         Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
         Reviewed-by: Ray Ni <ray...@intel.com>
         Message-Id: <20240222160106.686484-5-kra...@redhat.com>
    +    Reviewed-by: Laszlo Ersek <ler...@redhat.com>

      ## UefiCpuPkg/Library/MpInitLib/MpLib.c ##
     @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: MpInitLibInitialize (
5:  3a089b25725e ! 5:  f23c0d125e48 UefiCpuPkg/MpInitLib: Add support for 
multiple HOBs to SaveCpuMpData()
    @@ Commit message

         Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
         Message-Id: <20240222160106.686484-6-kra...@redhat.com>
    +    Reviewed-by: Ray Ni <ray...@intel.com>
    +    Reviewed-by: Laszlo Ersek <ler...@redhat.com>
    +    [ler...@redhat.com: define one local variable per line [Ray]]

      ## UefiCpuPkg/Library/MpInitLib/PeiMpLib.c ##
     @@ UefiCpuPkg/Library/MpInitLib/PeiMpLib.c: SaveCpuMpData (
        IN CPU_MP_DATA  *CpuMpData
        )
      {
    -+  UINT32           MaxCpusPerHob, CpusInHob;
    ++  UINT32           MaxCpusPerHob;
    ++  UINT32           CpusInHob;
        UINT64           Data64;
     -  UINTN            Index;
    -+  UINT32           Index, HobBase;
    ++  UINT32           Index;
    ++  UINT32           HobBase;
        CPU_INFO_IN_HOB  *CpuInfoInHob;
        MP_HAND_OFF      *MpHandOff;
        UINTN            MpHandOffSize;
6:  09435495e6e1 ! 6:  fbd8a114cd6e UefiCpuPkg/MpInitLib: return early in 
GetBspNumber()
    @@ Commit message
         Suggested-by: Laszlo Ersek <ler...@redhat.com>
         Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
         Message-Id: <20240222160106.686484-7-kra...@redhat.com>
    +    Reviewed-by: Ray Ni <ray...@intel.com>
    +    Reviewed-by: Laszlo Ersek <ler...@redhat.com>
    +    [ler...@redhat.com: s/ASSERT (FALSE)/ASSERT_EFI_ERROR (EFI_NOT_FOUND)/ 
[Ray]]

      ## UefiCpuPkg/Library/MpInitLib/MpLib.c ##
     @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: GetBspNumber (
    @@ UefiCpuPkg/Library/MpInitLib/MpLib.c: GetBspNumber (
     -  ASSERT (BspNumber != MAX_UINT32);
     -
     -  return BspNumber;
    -+  ASSERT (FALSE);
    ++  ASSERT_EFI_ERROR (EFI_NOT_FOUND);
     +  return 0;
      }



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115969): https://edk2.groups.io/g/devel/message/115969
Mute This Topic: https://groups.io/mt/104510905/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to