[edk2-devel] [PATCH v3 0/4] Use XADD to avoid lock acquire/release

Ni, Ray posted 4 patches 3 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/20210209141634.1999-1-ray.ni@intel.com
MdePkg/Include/Ia32/Nasm.inc                  |  38 ++++++
MdePkg/Include/X64/Nasm.inc                   |  38 ++++++
UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   5 +-
UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc   |  43 -------
.../Library/MpInitLib/Ia32/MpFuncs.nasm       |  98 +++++++---------
UefiCpuPkg/Library/MpInitLib/MpEqu.inc        |  99 ++++++++++++++++
UefiCpuPkg/Library/MpInitLib/MpLib.c          |   1 -
UefiCpuPkg/Library/MpInitLib/MpLib.h          |   3 +-
UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   5 +-
UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc    |  45 --------
UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 ++++++++----------
11 files changed, 272 insertions(+), 211 deletions(-)
delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc
delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc
[edk2-devel] [PATCH v3 0/4] Use XADD to avoid lock acquire/release
Posted by Ni, Ray 3 years, 2 months ago
Patch #1 follows Mike's suggestion to use XADD to avoid lock acquire/release.
Patch #2 follows Laszlo's suggestion to add global NASM macros for NASM struc usage.
Patch #3 simply remves all hardcode offset in NASM without changing any logic.
Patch #4 removes the dead code.

The final code is the same as that of V2.

Ray Ni (4):
  UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release
  MdePkg/Nasm.inc: add macros for C types used in structure definition
  UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset
  UefiCpuPkg/MpInitLib: Remove unused Lock from MP_CPU_EXCHANGE_INFO

 MdePkg/Include/Ia32/Nasm.inc                  |  38 ++++++
 MdePkg/Include/X64/Nasm.inc                   |  38 ++++++
 UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   5 +-
 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc   |  43 -------
 .../Library/MpInitLib/Ia32/MpFuncs.nasm       |  98 +++++++---------
 UefiCpuPkg/Library/MpInitLib/MpEqu.inc        |  99 ++++++++++++++++
 UefiCpuPkg/Library/MpInitLib/MpLib.c          |   1 -
 UefiCpuPkg/Library/MpInitLib/MpLib.h          |   3 +-
 UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   5 +-
 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc    |  45 --------
 UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 ++++++++----------
 11 files changed, 272 insertions(+), 211 deletions(-)
 delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
 create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc
 delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc

-- 
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71516): https://edk2.groups.io/g/devel/message/71516
Mute This Topic: https://groups.io/mt/80504933/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v3 0/4] Use XADD to avoid lock acquire/release
Posted by Laszlo Ersek 3 years, 1 month ago
On 02/09/21 15:16, Ni, Ray wrote:
> Patch #1 follows Mike's suggestion to use XADD to avoid lock acquire/release.
> Patch #2 follows Laszlo's suggestion to add global NASM macros for NASM struc usage.
> Patch #3 simply remves all hardcode offset in NASM without changing any logic.
> Patch #4 removes the dead code.
> 
> The final code is the same as that of V2.

Given that I was OK with v2:

series
Acked-by: Laszlo Ersek <lersek@redhat.com>

Thanks
Laszlo

> Ray Ni (4):
>   UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release
>   MdePkg/Nasm.inc: add macros for C types used in structure definition
>   UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset
>   UefiCpuPkg/MpInitLib: Remove unused Lock from MP_CPU_EXCHANGE_INFO
> 
>  MdePkg/Include/Ia32/Nasm.inc                  |  38 ++++++
>  MdePkg/Include/X64/Nasm.inc                   |  38 ++++++
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc   |  43 -------
>  .../Library/MpInitLib/Ia32/MpFuncs.nasm       |  98 +++++++---------
>  UefiCpuPkg/Library/MpInitLib/MpEqu.inc        |  99 ++++++++++++++++
>  UefiCpuPkg/Library/MpInitLib/MpLib.c          |   1 -
>  UefiCpuPkg/Library/MpInitLib/MpLib.h          |   3 +-
>  UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc    |  45 --------
>  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 ++++++++----------
>  11 files changed, 272 insertions(+), 211 deletions(-)
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
>  create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72208): https://edk2.groups.io/g/devel/message/72208
Mute This Topic: https://groups.io/mt/80504933/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-