Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release

2021-02-04 Thread Ni, Ray
> > (1) For more clarity, I would suggest > > lock xadd dword [edi], ebx > > (even though "ebx" already specifies the width, yes) > > Applies to the X64 version too. OK. > > > > +incebx ; EBX is CpuNumber > > > > +; program stack > > (2)

Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release

2021-02-04 Thread Laszlo Ersek
On 02/04/21 12:24, Zeng, Star wrote: > Hi All, > > Do you think it worth or not to also update MpFuncs.nasm in > Edk2\UefiCpuPkg\PiSmmCpuDxeSmm? I haven't done any measurements, so I couldn't say... -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group.

Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release

2021-02-04 Thread Zeng, Star
lo Ersek ; Dong, Eric ; > Kumar, Rahul1 > Subject: [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Use XADD to avoid > lock acquire/release > > When AP firstly wakes up, MpFuncs.nasm contains below logic to assign an > unique ApIndex to each AP according to who comes first: &

Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release

2021-02-04 Thread Laszlo Ersek
On 02/04/21 03:59, Ni, Ray wrote: > When AP firstly wakes up, MpFuncs.nasm contains below logic to assign > an unique ApIndex to each AP according to who comes first: > ---ASM--- > TestLock: > xchg [edi], eax > cmpeax, NotVacantFlag > jz TestLock > > mov

[edk2-devel] [PATCH 2/2] UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release

2021-02-03 Thread Ni, Ray
When AP firstly wakes up, MpFuncs.nasm contains below logic to assign an unique ApIndex to each AP according to who comes first: ---ASM--- TestLock: xchg [edi], eax cmpeax, NotVacantFlag jz TestLock movecx, esi addecx, ApIndexLocation