Re: [edk2-devel] [PATCH v2 0/6] Refine SMM CPU Sync flow and abstract SmmCpuSyncLib

2023-12-05 Thread Wu, Jiaxin
Hi All, Could you help review the series patches in v2? Thank you very much! Jiaxin > -Original Message- > From: devel@edk2.groups.io On Behalf Of Wu, > Jiaxin > Sent: Thursday, November 30, 2023 2:32 PM > To: devel@edk2.groups.io > Cc: Laszlo Ersek ; Dong, Eric

Re: [edk2-devel] [Patch V2] UefiCpuPkg/PiSmmCpuDxeSmm: SmmCpuRendezvous ensure all Aps in Present.

2023-12-05 Thread Wu, Jiaxin
> (1) Here's why I don't like this: > > we already have a function that is supposed to do this, and it is > SmmWaitForApArrival(). > > SmmWaitForApArrival() is called in two contexts. One, in BSPHandler(). > Two, here. > > Consider the following condition: > > (SyncMode == SmmCpuSyncModeTradi

Re: [edk2-devel] [PATCH v2 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-05 Thread Wu, Jiaxin
> > +struct SMM_CPU_SYNC_CTX { > > 1. How about "SMM_CPU_SYNC_CONTEXT"? Agree. > > > + /// > > + /// All global semaphores' pointer in SMM CPU Sync > > + /// > > + SMM_CPU_SYNC_SEMAPHORE_GLOBAL*GlobalSem; > > 2. There is only one GlobalSem. Can you directly use "volatile UINT32 > *C

[edk2-devel] [PATCH v3 0/6] Refine SMM CPU Sync flow and abstract SmmCpuSyncLib

2023-12-06 Thread Wu, Jiaxin
The series patches are to refine SMM CPU Sync flow. After the refinement, SmmCpuSyncLib is abstracted for any user to provide different SMM CPU Sync implementation. Compared to V2, has following refinement & changes: 1. rename SMM_CPU_SYNC_CXT to SMM_CPU_SYNC_CONTEXT 2. rename SemBlock to SemBuffe

[edk2-devel] [PATCH v3 1/6] UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and AP

2023-12-06 Thread Wu, Jiaxin
This patch is to define 3 new functions (WaitForBsp & ReleaseBsp & ReleaseOneAp) used for the semaphore sync between BSP & AP. With the change, BSP and AP Sync flow will be easy understand as below: BSP: ReleaseAllAPs or ReleaseOneAp --> AP: WaitForBsp BSP: WaitForAllAPs <-- AP: Rel

[edk2-devel] [PATCH v3 2/6] UefiCpuPkg: Adds SmmCpuSyncLib library class

2023-12-06 Thread Wu, Jiaxin
Intel is planning to provide different SMM CPU Sync implementation along with some specific registers to improve the SMI performance, hence need SmmCpuSyncLib Library for Intel. This patch is to: 1.Adds SmmCpuSyncLib Library class in UefiCpuPkg.dec. 2.Adds SmmCpuSyncLib.h function declaration head

[edk2-devel] [PATCH v3 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-06 Thread Wu, Jiaxin
Implements SmmCpuSyncLib Library instance. The instance refers the existing SMM CPU driver (PiSmmCpuDxeSmm) sync implementation and behavior: 1.Abstract Counter and Run semaphores into SmmCpuSyncCtx. 2.Abstract CPU arrival count operation to SmmCpuSyncGetArrivedCpuCount(), SmmCpuSyncCheckInCpu(), S

[edk2-devel] [PATCH v3 4/6] OvmfPkg: Specifies SmmCpuSyncLib instance

2023-12-06 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for OvmfPkg. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Jiaxin Wu --- OvmfPkg/CloudHv/CloudHvX64.dsc | 2 ++ OvmfPkg/OvmfPkgI

[edk2-devel] [PATCH v3 5/6] UefiPayloadPkg: Specifies SmmCpuSyncLib instance

2023-12-06 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for UefiPayloadPkg. Cc: Laszlo Ersek Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ray Ni Cc: Zeng Star Signed-off-by: Jiaxin Wu Reviewed-by: Gua Guo --- UefiPayloadPkg/UefiPayloadPkg.dsc | 1 + 1 file changed, 1 insertion(+) d

[edk2-devel] [PATCH v3 6/6] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SmmCpuSyncLib

2023-12-06 Thread Wu, Jiaxin
There is the SmmCpuSyncLib Library class define the SMM CPU sync flow, which is aligned with existing SMM CPU driver sync behavior. This patch is to consume SmmCpuSyncLib instance directly. With this change, SMM CPU Sync flow/logic can be customized with different implementation no matter for any

Re: [edk2-devel] [PATCH v3 2/6] UefiCpuPkg: Adds SmmCpuSyncLib library class

2023-12-12 Thread Wu, Jiaxin
> > Thanks. This documentation (in the commit message and the lib class > header file) seems really good (especially with the formatting updates > suggested by Ray). > > (1) I think there is one typo: exist <-> exits. > agree, I will fix this. > > +RETURN_STATUS > > +EFIAPI > > +SmmCpuSyncCont

Re: [edk2-devel] [Patch V2] UefiCpuPkg/PiSmmCpuDxeSmm: SmmCpuRendezvous ensure all Aps in Present.

2023-12-13 Thread Wu, Jiaxin
> > WaitForAllAPs() has two purpose: > >1. Make sure all Aps have set the Present. > >2. Get ready for programming MTRRs to make sure cpus in the same start > line. > > > > if so, that will be better as existing logic, it can also save some time > > for the > Present flag check in SmmWai

Re: [edk2-devel] [PATCH v3 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-14 Thread Wu, Jiaxin
Hi Laszlo, Really appreciate your comments! I checked one by one and feedback as below, thank you & Ray again & again for patch refinement > > (1) If / when you update the documentation in patch#2, please update > this one as well. > Yes, I will do the alignment. > (2) Please sort the #

Re: [edk2-devel] [PATCH v3 4/6] OvmfPkg: Specifies SmmCpuSyncLib instance

2023-12-14 Thread Wu, Jiaxin
> > > > !if $(SOURCE_DEBUG_ENABLE) == TRUE > > All four DSC files already include "PiSmmCpuDxeSmm.inf" like this: > > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf { > > ... > } > > Given that this new library class is again exclusively used by > PiSmmCpuDxeSmm, can you please res

Re: [edk2-devel] [PATCH v3 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-14 Thread Wu, Jiaxin
> > The code will be changed to: > > > > if ((INT32)InternalWaitForSemaphore (Context->CpuCount) < 0) { > > return RETURN_ABORTED; > > } > > I find this quite ugly. In the "semaphore post" operation, we already > have code that prevents incrementing if the semaphore is "locked". Can > we p

Re: [edk2-devel] [PATCH v3 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-14 Thread Wu, Jiaxin
BTW, for SmmCpuSyncGetArrivedCpuCount (): we can't check the CpuCount (Original is named as Counter Sem) is locked or not, then decide return from the *Context->CpuCount or locked value for the arrived CPU in SMI. Just like: if (*Context->CpuCount == MAX_UINT32) {--> does not meet t

Re: [edk2-devel] [PATCH v3 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-14 Thread Wu, Jiaxin
; -Original Message- > From: Wu, Jiaxin > Sent: Thursday, December 14, 2023 11:35 PM > To: devel@edk2.groups.io; ler...@redhat.com > Cc: Dong, Eric ; Ni, Ray ; Zeng, Star > ; Gerd Hoffmann ; Kumar, Rahul R > > Subject: RE: [edk2-devel] [PATCH v3 3/6] UefiCpuPkg:

Re: [edk2-devel] [PATCH v3 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-14 Thread Wu, Jiaxin
uCount no mater locked or not. So, ignore below case. Thanks, Jiaxin > -Original Message- > From: Wu, Jiaxin > Sent: Thursday, December 14, 2023 11:55 PM > To: devel@edk2.groups.io; ler...@redhat.com > Cc: Dong, Eric ; Ni, Ray ; Zeng, Star > ; Gerd Hoffmann ; Kumar

[edk2-devel] [PATCH v4 0/8] Refine SMM CPU Sync flow and abstract SmmCpuSyncLib

2023-12-15 Thread Wu, Jiaxin
The series patches are to refine SMM CPU Sync flow. After the refinement, SmmCpuSyncLib is abstracted for any user to provide different SMM CPU Sync implementation. Jiaxin Wu (8): UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and AP UefiCpuPkg: Adds SmmCpuSyncLib library clas

[edk2-devel] [PATCH v4 1/8] UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and AP

2023-12-15 Thread Wu, Jiaxin
This patch is to define 3 new functions (WaitForBsp & ReleaseBsp & ReleaseOneAp) used for the semaphore sync between BSP & AP. With the change, BSP and AP Sync flow will be easy understand as below: BSP: ReleaseAllAPs or ReleaseOneAp --> AP: WaitForBsp BSP: WaitForAllAPs <-- AP: Rel

[edk2-devel] [PATCH v4 2/8] UefiCpuPkg: Adds SmmCpuSyncLib library class

2023-12-15 Thread Wu, Jiaxin
Intel is planning to provide different SMM CPU Sync implementation along with some specific registers to improve the SMI performance, hence need SmmCpuSyncLib Library for Intel. This patch is to: 1.Adds SmmCpuSyncLib Library class in UefiCpuPkg.dec. 2.Adds SmmCpuSyncLib.h function declaration head

[edk2-devel] [PATCH v4 3/8] MdePkg/MdeLibs.dsc.inc: Add SafeIntLib instance

2023-12-15 Thread Wu, Jiaxin
This patch is to add SafeIntLib in MdeLibs.dsc.inc Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Laszlo Ersek Cc: Ray Ni Cc: Zeng Star Signed-off-by: Jiaxin Wu --- MdePkg/MdeLibs.dsc.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/MdePkg/MdeLibs.dsc.inc b/MdePkg/MdeLibs.

[edk2-devel] [PATCH v4 4/8] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-15 Thread Wu, Jiaxin
Implements SmmCpuSyncLib Library instance. The instance refers the existing SMM CPU driver (PiSmmCpuDxeSmm) sync implementation and behavior: 1.Abstract Counter and Run semaphores into SmmCpuSyncCtx. 2.Abstract CPU arrival count operation to SmmCpuSyncGetArrivedCpuCount(), SmmCpuSyncCheckInCpu(), S

[edk2-devel] [PATCH v4 5/8] OvmfPkg: Specifies SmmCpuSyncLib instance

2023-12-15 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for OvmfPkg. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Jiaxin Wu --- OvmfPkg/CloudHv/CloudHvX64.dsc | 1 + OvmfPkg/OvmfPkgIa

[edk2-devel] [PATCH v4 6/8] UefiPayloadPkg: Specifies SmmCpuSyncLib instance

2023-12-15 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for UefiPayloadPkg. Cc: Laszlo Ersek Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ray Ni Cc: Zeng Star Signed-off-by: Jiaxin Wu Reviewed-by: Gua Guo --- UefiPayloadPkg/UefiPayloadPkg.dsc | 1 + 1 file changed, 1 insertion(+) d

[edk2-devel] [PATCH v4 7/8] UefiCpuPkg/PiSmmCpuDxeSmm: Simplify RunningApCount decrement

2023-12-15 Thread Wu, Jiaxin
To decrease the count of RunningApCount, InterlockedDecrement is enough to achieve that. This patch is to simplify RunningApCount decrement. Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- UefiCpuPkg/PiSmmCpuDxeSmm/MpS

[edk2-devel] [PATCH v4 8/8] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SmmCpuSyncLib

2023-12-15 Thread Wu, Jiaxin
There is the SmmCpuSyncLib Library class define the SMM CPU sync flow, which is aligned with existing SMM CPU driver sync behavior. This patch is to consume SmmCpuSyncLib instance directly. With this change, SMM CPU Sync flow/logic can be customized with different implementation no matter for any

Re: [edk2-devel] [PATCH v4 4/8] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-18 Thread Wu, Jiaxin
Thanks Ray. > > 1. It's not "LockedCpuCount". It's "ArrivedCpuCountUponLock". > Comments can be: > Before the door is locked, CpuCount stores the arrived CPU count. > After the door is locked, CpuCount is set to -1 indicating the door is > locked. > ArrivedCpuCpuntUponLock stores the a

[edk2-devel] [PATCH v5 0/8] Refine SMM CPU Sync flow and abstract SmmCpuSyncLib

2023-12-18 Thread Wu, Jiaxin
The series patches are to refine SMM CPU Sync flow. After the refinement, SmmCpuSyncLib is abstracted for any user to provide different SMM CPU Sync implementation. Jiaxin Wu (8): UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and AP UefiCpuPkg: Adds SmmCpuSyncLib library class

[edk2-devel] [PATCH v5 1/8] UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and AP

2023-12-18 Thread Wu, Jiaxin
This patch is to define 3 new functions (WaitForBsp & ReleaseBsp & ReleaseOneAp) used for the semaphore sync between BSP & AP. With the change, BSP and AP Sync flow will be easy understand as below: BSP: ReleaseAllAPs or ReleaseOneAp --> AP: WaitForBsp BSP: WaitForAllAPs <-- AP: Rel

[edk2-devel] [PATCH v5 2/8] UefiCpuPkg: Adds SmmCpuSyncLib library class

2023-12-18 Thread Wu, Jiaxin
Intel is planning to provide different SMM CPU Sync implementation along with some specific registers to improve the SMI performance, hence need SmmCpuSyncLib Library for Intel. This patch is to: 1.Adds SmmCpuSyncLib Library class in UefiCpuPkg.dec. 2.Adds SmmCpuSyncLib.h function declaration head

[edk2-devel] [PATCH v5 3/8] MdePkg/MdeLibs.dsc.inc: Add SafeIntLib instance

2023-12-18 Thread Wu, Jiaxin
This patch is to add SafeIntLib in MdeLibs.dsc.inc Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Laszlo Ersek Cc: Ray Ni Cc: Zeng Star Signed-off-by: Jiaxin Wu Reviewed-by: Michael D Kinney --- MdePkg/MdeLibs.dsc.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/MdePkg/Md

[edk2-devel] [PATCH v5 4/8] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-18 Thread Wu, Jiaxin
Implements SmmCpuSyncLib Library instance. The instance refers the existing SMM CPU driver (PiSmmCpuDxeSmm) sync implementation and behavior: 1.Abstract Counter and Run semaphores into SmmCpuSyncCtx. 2.Abstract CPU arrival count operation to SmmCpuSyncGetArrivedCpuCount(), SmmCpuSyncCheckInCpu(), S

[edk2-devel] [PATCH v5 5/8] OvmfPkg: Specifies SmmCpuSyncLib instance

2023-12-18 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for OvmfPkg. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Jiaxin Wu Reviewed-by: Ray Ni --- OvmfPkg/CloudHv/CloudHvX64.dsc | 1

[edk2-devel] [PATCH v5 6/8] UefiPayloadPkg: Specifies SmmCpuSyncLib instance

2023-12-18 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for UefiPayloadPkg. Cc: Laszlo Ersek Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ray Ni Cc: Zeng Star Signed-off-by: Jiaxin Wu Reviewed-by: Gua Guo Reviewed-by: Ray Ni --- UefiPayloadPkg/UefiPayloadPkg.dsc | 1 + 1 file chang

[edk2-devel] [PATCH v5 7/8] UefiCpuPkg/PiSmmCpuDxeSmm: Simplify RunningApCount decrement

2023-12-18 Thread Wu, Jiaxin
To decrease the count of RunningApCount, InterlockedDecrement is enough to achieve that. This patch is to simplify RunningApCount decrement. Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu Reviewed-by: Ray Ni --- UefiCpuP

[edk2-devel] [PATCH v5 8/8] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SmmCpuSyncLib

2023-12-18 Thread Wu, Jiaxin
There is the SmmCpuSyncLib Library class define the SMM CPU sync flow, which is aligned with existing SMM CPU driver sync behavior. This patch is to consume SmmCpuSyncLib instance directly. With this change, SMM CPU Sync flow/logic can be customized with different implementation no matter for any

Re: [edk2-devel] [PATCH v5 4/8] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-19 Thread Wu, Jiaxin
Thanks all help review this series patches, I have created one PR integrated all reviewed by tag for this series patches. https://github.com/tianocore/edk2/pull/5092 Thanks, Jiaxin > -Original Message- > From: Ni, Ray > Sent: Tuesday, December 19, 2023 5:34 PM > To

[edk2-devel] [PATCH v1 0/6] Reduce one round BSP & AP sync

2023-12-20 Thread Wu, Jiaxin
Jiaxin Wu (6): SourceLevelDebugPkg/Library: Indicate SMM Debug Agent support or not MdeModulePkg/DebugAgentLibNull: Indicate SMM Debug Agent support or not UefiCpuPkg/PiSmmCpuDxeSmm: Check SMM Debug Agent support or not UefiCpuPkg/PiSmmCpuDxeSmm: Align MTRR sync logic between BSP and AP

[edk2-devel] [PATCH v1 2/6] MdeModulePkg/DebugAgentLibNull: Indicate SMM Debug Agent support or not

2023-12-20 Thread Wu, Jiaxin
This patch use the Context to indicate SMM Debug Agent support or not if InitFlag is DEBUG_AGENT_INIT_SMM. Context must be the pointer to the BOOLEAN value if it's not NULL. Cc: Ray Ni Cc: Liming Gao Signed-off-by: Jiaxin Wu --- MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.c | 9 ++

[edk2-devel] [PATCH v1 1/6] SourceLevelDebugPkg/Library: Indicate SMM Debug Agent support or not

2023-12-20 Thread Wu, Jiaxin
This patch use the Context to indicate SMM Debug Agent support or not if InitFlag is DEBUG_AGENT_INIT_SMM. Context must be the pointer to the BOOLEAN value if it's not NULL. Cc: Ray Ni Signed-off-by: Jiaxin Wu --- .../Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c| 14 ++ 1

[edk2-devel] [PATCH v1 3/6] UefiCpuPkg/PiSmmCpuDxeSmm: Check SMM Debug Agent support or not

2023-12-20 Thread Wu, Jiaxin
This patch is to check SMM Debug Agent support or not before InitializeDebugAgent. Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 4 +++- UefiCpuPkg/PiSmmCpuDxeSmm/MpServic

[edk2-devel] [PATCH v1 4/6] UefiCpuPkg/PiSmmCpuDxeSmm: Align MTRR sync logic between BSP and AP

2023-12-20 Thread Wu, Jiaxin
Below piece of code is to sync logic in AP for MTRR programming: if (SmmCpuFeaturesNeedConfigureMtrrs ()) { SmmCpuSyncReleaseBsp (); SmmCpuSyncWaitForBsp (); ... } SmmCpuSyncReleaseBsp (); SmmCpuSyncWaitForBsp (); This patch is to make BSP sync logic same as above coding style:

[edk2-devel] [PATCH v1 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Invert ReleaseAllAPs & InitializeDebugAgent

2023-12-20 Thread Wu, Jiaxin
Below BSP & AP sync flow before exit SMI is to: 1. Make sure BSP and all APs finish the MTRR programming and start later executing the same start line. This is the MTRR programming requirement. 2. Make sure all APs finish the pending tasks, then BSP can stop source level debug. BSP: SmmCpuSyncWaitF

[edk2-devel] [PATCH v1 6/6] UefiCpuPkg/PiSmmCpuDxeSmm: Reduce one round BSP & AP sync

2023-12-20 Thread Wu, Jiaxin
One round BSP & AP sync for exit SMI is shown as below: BSP: SmmCpuSyncWaitForAPs <-- AP: SmmCpuSyncReleaseBsp BSP: ReleaseAllAPs --> AP: SmmCpuSyncWaitForBsp Above is only required if need configure MTRR and support SMM source level debug, So, reduce one round BSP & AP sync if both are

[edk2-devel] [PATCH v1] Platform/Intel: Specifies SmmCpuSyncLib instance

2023-12-20 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for MinPlatformPkg Cc: Chasel Chiu Cc: Nate DeSimone Cc: Michael D Kinney Cc: Liming Gao Cc: Ray Ni Signed-off-by: Jiaxin Wu --- Platform/Intel/MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/Pl

[edk2-devel] [PATCH v2 0/6] Reduce one round BSP & AP sync

2023-12-25 Thread Wu, Jiaxin
This version is updated according Ray's comments on https://github.com/tianocore/edk2/pull/5175 Jiaxin Wu (6): SourceLevelDebugPkg/Library: Indicate SMM Debug Agent support or not MdeModulePkg/DebugAgentLibNull: Indicate SMM Debug Agent support or not UefiCpuPkg/PiSmmCpuDxeSmm: Check SMM

[edk2-devel] [PATCH v2 1/6] SourceLevelDebugPkg/Library: Indicate SMM Debug Agent support or not

2023-12-25 Thread Wu, Jiaxin
This patch is to use the Context to indicate SMM Debug Agent support or not if InitFlag is DEBUG_AGENT_INIT_SMM. Context must point to a BOOLEAN if it's not NULL. Cc: Ray Ni Signed-off-by: Jiaxin Wu --- .../Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c| 14 ++ 1 file chang

[edk2-devel] [PATCH v2 2/6] MdeModulePkg/DebugAgentLibNull: Indicate SMM Debug Agent support or not

2023-12-25 Thread Wu, Jiaxin
This patch is to use the Context to indicate SMM Debug Agent support or not if InitFlag is DEBUG_AGENT_INIT_SMM. Context must point to a BOOLEAN if it's not NULL. Cc: Ray Ni Cc: Liming Gao Signed-off-by: Jiaxin Wu --- MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.c | 9 + 1

[edk2-devel] [PATCH v2 3/6] UefiCpuPkg/PiSmmCpuDxeSmm: Check SMM Debug Agent support or not

2023-12-25 Thread Wu, Jiaxin
This patch is to check SMM Debug Agent support or not before InitializeDebugAgent. Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 4 +++- UefiCpuPkg/PiSmmCpuDxeSmm/MpServic

[edk2-devel] [PATCH v2 4/6] UefiCpuPkg/PiSmmCpuDxeSmm: Align BSP and AP sync logic for SMI exit

2023-12-25 Thread Wu, Jiaxin
Below piece of code is the BSP and AP sync logic for SMI exit. 1. AP after finish the scheduled procedure: if (SmmCpuFeaturesNeedConfigureMtrrs ()) { SmmCpuSyncReleaseBsp (); SmmCpuSyncWaitForBsp (); ... } SmmCpuSyncReleaseBsp (); SmmCpuSyncWaitForBsp (); SmmCpuSyncReleaseBsp

[edk2-devel] [PATCH v2 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Invert ReleaseAllAPs & InitializeDebugAgent

2023-12-25 Thread Wu, Jiaxin
Existing BSP handler stops source level debug, then call ReleaseAllAPs to tell all APs can reset the Present flag to FALSE: InitializeDebugAgent (); /// Stop source level debug ReleaseAllAPs ();/// Tell APs can reset "Present" flag. This patch is to invert ReleaseAllAPs & InitializeDeb

[edk2-devel] [PATCH v2 6/6] UefiCpuPkg/PiSmmCpuDxeSmm: Reduce one round BSP & AP sync

2023-12-25 Thread Wu, Jiaxin
After BSP returned from SmmCoreEntry, there are several rounds BSP and AP sync in BSP handler: 1 .ReleaseAllAPs(); /// Notify all APs to exit. if (SmmCpuFeaturesNeedConfigureMtrrs()) { 2. SmmCpuSyncWaitForAPs(); /// Wait for all APs to program MTRRs. 3. ReleaseAllAPs(); /// Signal APs to rest

[edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-03 Thread Wu, Jiaxin
Shadow stack will stop update after CET disable (DisableCet in DisableReadOnlyPageWriteProtect), but normal smi stack will be continue updated with the function return and enter (DisableReadOnlyPageWriteProtect & EnableReadOnlyPageWriteProtect), thus leading stack mismatch after CET re-enabled (Ena

Re: [edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-03 Thread Wu, Jiaxin
Hi Laszlo, Thanks the feedback. > > Is this somehow related to > > [edk2-devel] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Clear CR4.CET before > restoring MSR IA32_S_CET > > at > > https://edk2.groups.io/g/devel/message/110605 > > ? > > I'm not familiar with control flow integrity, but both pa

[edk2-devel] [PATCH v1 0/7] Refine SMM CPU Sync flow and abstract SmmCpuSyncLib

2023-11-03 Thread Wu, Jiaxin
ordan Justen Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Jiaxin Wu Jiaxin Wu (7): UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and AP UefiCpuPkg/PiSmmCpuDxeSmm: Reduce times of BSP and AP Sync for SMM Exit UefiCpuPkg: Adds SmmCpuSyncLib li

[edk2-devel] [PATCH v1 1/7] UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and AP

2023-11-03 Thread Wu, Jiaxin
This patch is to define 3 new functions (WaitForBsp & ReleaseBsp & ReleaseOneAp) used for the semaphore sync between BSP & AP. With the change, BSP and AP Sync flow will be easy understand as below: BSP: ReleaseAllAPs or ReleaseOneAp --> AP: WaitForBsp BSP: WaitForAllAPs <-- AP: Rel

[edk2-devel] [PATCH v1 2/7] UefiCpuPkg/PiSmmCpuDxeSmm: Reduce times of BSP and AP Sync for SMM Exit

2023-11-03 Thread Wu, Jiaxin
After review, there are unnecessary steps for BSP and AP sync for SMM exit. This patch is to reduce one round BSP and AP sync so as to improve SMI performance: BSP: WaitForAllAPs <-- AP: ReleaseBsp BSP: ReleaseAllAPs --> AP: WaitForBsp Change-Id: Ic33f42f3daa7ff1847e524d0c3d9cd4fcdefa61b Cc: Eric

[edk2-devel] [PATCH v1 3/7] UefiCpuPkg: Adds SmmCpuSyncLib library class

2023-11-03 Thread Wu, Jiaxin
Intel is planning to provide different SMM CPU Sync implementation along with some specific registers to improve the SMI performance, hence need SmmCpuSyncLib Library for Intel. This patch is to: 1.Adds SmmCpuSyncLib Library class in UefiCpuPkg.dec. 2.Adds SmmCpuSyncLib.h function declaration head

[edk2-devel] [PATCH v1 4/7] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-11-03 Thread Wu, Jiaxin
Implements SmmCpuSyncLib Library class. The instance follows the existing SMM CPU driver (PiSmmCpuDxeSmm) sync implementation: 1.Abstract Counter and Run semaphores into SmmCpuSyncCtx. 2.Abstract CPU arrival count operation to SmmCpuSyncGetArrivedCpuCount(), SmmCpuSyncCheckInCpu(), SmmCpuSyncCheckO

[edk2-devel] [PATCH v1 5/7] OvmfPkg: Specifies SmmCpuSyncLib instance

2023-11-03 Thread Wu, Jiaxin
The SmmCpuSyncLib instance is included in UefiCpuLibs.dsc.inc. This patch is to specify SmmCpuSyncLib instance in OvmfPkg by using "!include UefiCpuPkg/UefiCpuLibs.dsc.inc". Change-Id: I2ab1737425e26a7bfc4f564b3b7f15ca5c2268fb Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Eric Dong C

[edk2-devel] [PATCH v1 6/7] UefiPayloadPkg: Specifies SmmCpuSyncLib instance

2023-11-03 Thread Wu, Jiaxin
The SmmCpuSyncLib instance is included in UefiCpuLibs.dsc.inc. This patch is to specify SmmCpuSyncLib instance in UefiPayloadPkg by using "!include UefiCpuPkg/UefiCpuLibs.dsc.inc". Change-Id: Ib303a9cdf260ac1ffc146e5f2e68834dec00ff25 Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ra

[edk2-devel] [PATCH v1 7/7] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SmmCpuSyncLib

2023-11-03 Thread Wu, Jiaxin
There is the SmmCpuSyncLib Library class define the SMM CPU sync flow, which is aligned with existing SMM CPU driver sync behavior. This patch is to consume SmmCpuSyncLib instance directly. With this change, SMM CPU Sync flow/logic can be customized with different implementation no matter for any

[edk2-devel] [PATCH v2] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-03 Thread Wu, Jiaxin
Shadow stack will stop update after CET disable (DisableCet in DisableReadOnlyPageWriteProtect), but normal smi stack will be continue updated with the function return and enter (DisableReadOnlyPageWriteProtect & EnableReadOnlyPageWriteProtect), thus leading stack mismatch after CET re-enabled (Ena

Re: [edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-03 Thread Wu, Jiaxin
Hi Laszlo, Thanks comments. > > I have two comments: > > > (1) both the pre-patch code and the post-patch code have several > instances of the following pattern: > > Boolean = (Expression != 0) ? TRUE : FALSE; > > This is an anti-pattern. It should only be: > > Boolean = Expression !=

[edk2-devel] [PATCH v3] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-05 Thread Wu, Jiaxin
Shadow stack will stop update after CET disable (DisableCet in DisableReadOnlyPageWriteProtect), but normal smi stack will be continue updated with the function return and enter (DisableReadOnlyPageWriteProtect & EnableReadOnlyPageWriteProtect), thus leading stack mismatch after CET re-enabled (Ena

Re: [edk2-devel] [PATCH v2] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-05 Thread Wu, Jiaxin
Thanks Laszlo, all fixed in version 3. > -Original Message- > From: Laszlo Ersek > Sent: Sunday, November 5, 2023 7:01 PM > To: Wu, Jiaxin ; devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray ; Zeng, Star > ; Gerd Hoffmann ; Kumar, Rahul R > > Subject: R

Re: [edk2-devel] [PATCH v3] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-06 Thread Wu, Jiaxin
I will refine the commit log to include your great suggestion. Thank you very much! Jiaxin From: Ni, Ray Sent: Monday, November 6, 2023 5:41 PM To: Wu, Jiaxin ; devel@edk2.groups.io Cc: Dong, Eric ; Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R ; Laszlo Ersek Subject: Re: [PATCH v3] Ue

[edk2-devel] [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-06 Thread Wu, Jiaxin
Root cause: 1. Before DisableReadonlyPageWriteProtect() is called, the return address (#1) is pushed in shadow stack. 2. CET is disabled. 3. DisableReadonlyPageWriteProtect() returns to #1. 4. Page table is modified. 5. EnableReadonlyPageWriteProtect() is called, but the return address (#2) is not

[edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Use processor extended information

2023-11-06 Thread Wu, Jiaxin
Processor extended information is filled when CPU_V2_EXTENDED_TOPOLOGY is set in parameter ProcessorNumber from GetProcessorInfo() (See commit: 1fadd18d). This filed value is retrieved from CPUID leaf 1FH, which is a preferred superset to leaf 0BH. Since Intel recommends first use the CPUID leaf

Re: [edk2-devel] [PATCH v1 7/7] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SmmCpuSyncLib

2023-11-07 Thread Wu, Jiaxin
Thanks Laszlo, much appreciate all comments. I will check one by one for fix in next version. /Jiaxin > -Original Message- > From: Laszlo Ersek > Sent: Tuesday, November 7, 2023 7:01 PM > To: devel@edk2.groups.io; Wu, Jiaxin > Cc: Dong, Eric ; Ni, Ray ; Zeng, Star &g

Re: [edk2-devel] [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-07 Thread Wu, Jiaxin
Hi Ray & Laszlo, Any more comments to this? Thanks, Jiaxin > -Original Message- > From: devel@edk2.groups.io On Behalf Of Wu, > Jiaxin > Sent: Tuesday, November 7, 2023 9:25 AM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray ; Zeng, Star > ; Gerd

Re: [edk2-devel] [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-07 Thread Wu, Jiaxin
Ersek > Sent: Wednesday, November 8, 2023 2:57 AM > To: devel@edk2.groups.io; Wu, Jiaxin > Cc: Dong, Eric ; Ni, Ray ; Zeng, Star > ; Gerd Hoffmann ; Kumar, Rahul R > > Subject: Re: [edk2-devel] [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP > Exception when CET enable >

Re: [edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Use processor extended information

2023-11-07 Thread Wu, Jiaxin
Hi Laszlo, > > > > The patch looks OK to me, but: > > > > - I would like to test it with CPU hotplug (later, likely under v2), and > > Sure, I can wait the update from you. > > - I think this should be two patches. > > > > First, the SmmAddProcessor() function should be extended just to > > comp

Re: [edk2-devel] [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-09 Thread Wu, Jiaxin
nal Message----- > From: Wu, Jiaxin > Sent: Wednesday, November 8, 2023 9:17 AM > To: Laszlo Ersek ; devel@edk2.groups.io; Gao, Liming > ; Kinney, Michael D > > Cc: Dong, Eric ; Ni, Ray ; Zeng, Star > ; Gerd Hoffmann ; Kumar, Rahul R > > Subject: RE: [edk2-devel] [PATCH

Re: [edk2-devel] [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-09 Thread Wu, Jiaxin
Thank you, Mike, the PR (https://github.com/tianocore/edk2/pull/4867) has been synced & updated with reviewed by tag, and we can merge once pass the CI check. > -Original Message- > From: Kinney, Michael D > Sent: Friday, November 10, 2023 8:25 AM > To: Wu, Jiaxi

[edk2-devel] [PATCH v2 0/3] Get and use Get processor extended information

2023-11-15 Thread Wu, Jiaxin
The series patches are to complete commits 170d4ce8 & 1fadd18d, then SMM cpu driver will use the processor extended information. Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Star Zeng Signed-off-by: Jiaxin Wu Jiaxin Wu (3): UefiCpuPkg/BaseXApicLib:

[edk2-devel] [PATCH v2 1/3] UefiCpuPkg/BaseXApicLib: Fix CPUID_V2_EXTENDED_TOPOLOGY detection

2023-11-15 Thread Wu, Jiaxin
This patch is to complete 170d4ce8, sync the change to BaseXApicLib. Checking the max cpuid leaf is not enough to figure whenever CPUID_V2_EXTENDED_TOPOLOGY is supported. Intel SDM says: Software must detect the presence of CPUID leaf 1FH by verifying (a) the highest leaf index supported by CPUI

[edk2-devel] [PATCH v2 2/3] UefiCpuPkg/PiSmmCpuDxeSmm: Get processor extended information

2023-11-15 Thread Wu, Jiaxin
This patch is to extend SmmAddProcessor function to get processor extended information. It's to complete commit 1fadd18d. Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Star Zeng Signed-off-by: Jiaxin Wu Reviewed-by: Laszlo Ersek Regression-tested-by: Laszl

[edk2-devel] [PATCH v2 3/3] UefiCpuPkg/PiSmmCpuDxeSmm: Use processor extended information

2023-11-15 Thread Wu, Jiaxin
This patch changes to use the processor extended information, which can reflect the value from CPUID leaf 1FH. The reasons are listed as below: 1. The processor package ID retrieved from CPUID 0x0Bh may be not correct/accurate if CPU has the module & die info, it depends on the CPUID implementatio

Re: [edk2-devel] [PATCH v1] UefiCpuPkg: Get processor extended information for SmmCpuServiceProtocol

2023-11-15 Thread Wu, Jiaxin
ks, Jiaxin > -Original Message- > From: joeyli > Sent: Wednesday, November 15, 2023 3:35 PM > To: devel@edk2.groups.io; Zhang, Hongbin1 > Cc: Dong, Eric ; Ni, Ray ; Kumar, > Rahul R ; Gerd Hoffmann ; > Zeng, Star ; Wu, Jiaxin > Subject: Re: [edk2-devel] [PATCH v1]

Re: [edk2-devel] [PATCH v2 3/3] UefiCpuPkg/PiSmmCpuDxeSmm: Use processor extended information

2023-11-20 Thread Wu, Jiaxin
domain is package. With all above, I agree to drop this path, but other 2 patches in this set should be ok. Thanks Ray help clarify this. Thanks, Jiaxin From: Ni, Ray Sent: Monday, November 20, 2023 9:45 AM To: Laszlo Ersek ; devel@edk2.groups.io; Wu, Jiaxin Cc: Dong, Eric ; Kumar, Rahul R

Re: [edk2-devel] [PATCH 1/1] StandaloneMmPkg/Core: Restart dispatcher once MmEntryPoint is registered

2023-11-27 Thread Wu, Jiaxin
> // > MM_CORE_MMI_HANDLERS mMmCoreMmiHandlers[] = { > + { MmDriverDispatchHandler, &gEfiEventDxeDispatchGuid, NULL, > TRUE }, Should we need define a new HandlerType name instead of using the gEfiEventDxeDispatchGuid? We just need a simple MM Dispatch Event, which is trigged by

[edk2-devel] [PATCH v2 0/6] Refine SMM CPU Sync flow and abstract SmmCpuSyncLib

2023-11-29 Thread Wu, Jiaxin
afeIntLib for all calculations to prevent overflows. i. Remove the UefiCpuPkg/UefiCpuLibs.dsc.inc Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gu

[edk2-devel] [PATCH v2 1/6] UefiCpuPkg/PiSmmCpuDxeSmm: Optimize Semaphore Sync between BSP and AP

2023-11-29 Thread Wu, Jiaxin
This patch is to define 3 new functions (WaitForBsp & ReleaseBsp & ReleaseOneAp) used for the semaphore sync between BSP & AP. With the change, BSP and AP Sync flow will be easy understand as below: BSP: ReleaseAllAPs or ReleaseOneAp --> AP: WaitForBsp BSP: WaitForAllAPs <-- AP: Rel

[edk2-devel] [PATCH v2 2/6] UefiCpuPkg: Adds SmmCpuSyncLib library class

2023-11-29 Thread Wu, Jiaxin
Intel is planning to provide different SMM CPU Sync implementation along with some specific registers to improve the SMI performance, hence need SmmCpuSyncLib Library for Intel. This patch is to: 1.Adds SmmCpuSyncLib Library class in UefiCpuPkg.dec. 2.Adds SmmCpuSyncLib.h function declaration head

[edk2-devel] [PATCH v2 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-11-29 Thread Wu, Jiaxin
Implements SmmCpuSyncLib Library instance. The instance refers the existing SMM CPU driver (PiSmmCpuDxeSmm) sync implementation and behavior: 1.Abstract Counter and Run semaphores into SmmCpuSyncCtx. 2.Abstract CPU arrival count operation to SmmCpuSyncGetArrivedCpuCount(), SmmCpuSyncCheckInCpu(), S

[edk2-devel] [PATCH v2 4/6] OvmfPkg: Specifies SmmCpuSyncLib instance

2023-11-29 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for OvmfPkg. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Jiaxin Wu --- OvmfPkg/CloudHv/CloudHvX64.dsc | 2 ++ OvmfPkg/OvmfPkgI

[edk2-devel] [PATCH v2 5/6] UefiPayloadPkg: Specifies SmmCpuSyncLib instance

2023-11-29 Thread Wu, Jiaxin
This patch is to specify SmmCpuSyncLib instance for UefiPayloadPkg. Cc: Laszlo Ersek Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ray Ni Cc: Zeng Star Signed-off-by: Jiaxin Wu --- UefiPayloadPkg/UefiPayloadPkg.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/UefiPayloa

[edk2-devel] [PATCH v2 6/6] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SmmCpuSyncLib

2023-11-29 Thread Wu, Jiaxin
There is the SmmCpuSyncLib Library class define the SMM CPU sync flow, which is aligned with existing SMM CPU driver sync behavior. This patch is to consume SmmCpuSyncLib instance directly. With this change, SMM CPU Sync flow/logic can be customized with different implementation no matter for any

Re: [edk2-devel] [PATCH v1 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg

2024-02-19 Thread Wu, Jiaxin
> From C11 "5.1.2.4 Multi-threaded executions and data races": > > - paragraph 4: "Two expression evaluations conflict if one of them > modifies a memory location and the other one reads or modifies the same > memory location." > > - paragraph 25: "The execution of a program contains a data race

Re: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization

2024-02-22 Thread Wu, Jiaxin
; From: gaoliming > Sent: Thursday, February 22, 2024 10:48 PM > To: Wu, Jiaxin > Subject: 回复: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization > > Jiaxin: > I see you merge this patch set in hard freeze. If you want this patch set > to catch this stable tag 202402, you need to repl

Re: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization

2024-02-22 Thread Wu, Jiaxin
Talked with Di & Liming, Those 2 patches don't need to catch this stable tag 202402. Please ignore the request here. Thanks, Jiaxin > -Original Message----- > From: Wu, Jiaxin > Sent: Friday, February 23, 2024 8:47 AM > To: gaoliming ; Kinney, Michael D > &g

[edk2-devel] [PATCH v1 0/2] SMM MP service performance Improvement

2024-03-06 Thread Wu, Jiaxin
The series patch are to improve the SMM MP service performance. Cc: Ray Ni Cc: Laszlo Ersek Cc: Eric Dong Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu Jiaxin Wu (2): UefiCpuPkg/PiSmmCpuDxeSmm: Remove one round of Busy spinlock UefiCpuPkg/PiSmmCpuDxeSmm

[edk2-devel] [PATCH v1 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove one round of Busy spinlock

2024-03-06 Thread Wu, Jiaxin
For both non blocking and blocking: Remove unnecessary a pair of AcquireSpinLock and ReleaseSpinLock for each AP. It's target to improve SmmStartupAllAPs performance. No functional impact, see below analysis: During first acquire spinLock, InternalSmmStartupAllAPs will return EFI_NOT_READY if Acq

[edk2-devel] [PATCH v1 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Make RunningApCount on exclusive cacheline

2024-03-06 Thread Wu, Jiaxin
For non blocking mode during SmmMpBroadcastProcedure, multiple APs might contended access the RunningApCount in the PROCEDURE_TOKEN: Step1: RunningApCount is initialized to the mMaxNumberOfCpus (See GetFreeToken). Step2: Decrease RunningApCount if the AP is not present (See InterlockedDecrement in

[edk2-devel] OVMF SMM Support

2024-04-08 Thread Wu, Jiaxin
Hi Gerd, With below OVMF build and QEMU command, OVMF hangs after SendSmiIpi (mBspApicId) during SmmRelocateBases(), is there any issues with latest code to support SMM on OVMF or my local command/configuration issue? Build (latest edk2 code): build -p OvmfPkg\OvmfPkgIa32X64.dsc -a IA32 -a X64

Re: [edk2-devel] OVMF SMM Support

2024-04-08 Thread Wu, Jiaxin
Thank you Michael & Gerd, it does the problem of https://gitlab.com/qemu-project/qemu/-/issues/2064. The issue is gone with latest QEMU version. Thanks, Jiaxin > -Original Message- > From: Michael Kubacki > Sent: Tuesday, April 9, 2024 8:55 AM > To: devel@edk2.group

[edk2-devel] [PATCH v1 00/13] Add SmmRelocationLib

2024-04-10 Thread Wu, Jiaxin
Processor. 2. Execute the early SMM Init. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ard Biesheuvel Cc: Jiewen Yao Signed-off-by: Jiaxin Wu Jiaxin Wu (13): UefiCpuPkg: Add SmmRelocationLib class UefiCpuPkg

[edk2-devel] [PATCH v1 01/13] UefiCpuPkg: Add SmmRelocationLib class

2024-04-10 Thread Wu, Jiaxin
Intel plans to separate the smbase relocation logic from PiSmmCpuDxeSmm driver, and the related behavior will be moved to the new interface defined by the SmmRelocationLib class. The SmmRelocationLib class provides the SmmRelocationInit() interface for platform to do the smbase relocation, which s

  1   2   3   4   5   >