public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
@ 2024-02-06  7:58 Wu, Jiaxin
  2024-02-06  7:58 ` [edk2-devel] [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting Wu, Jiaxin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Wu, Jiaxin @ 2024-02-06  7:58 UTC (permalink / raw)
  To: devel

In V3 patch set, drop the patch to update the CheckFeatureSupported.

The new patch set only focus on the BspIndex refinement.

Jiaxin Wu (2):
  UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
  UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg

 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

-- 
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115149): https://edk2.groups.io/g/devel/message/115149
Mute This Topic: https://groups.io/mt/104194203/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [edk2-devel] [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
  2024-02-06  7:58 [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization Wu, Jiaxin
@ 2024-02-06  7:58 ` Wu, Jiaxin
  2024-02-06  8:56   ` Ni, Ray
  2024-02-06 14:33   ` Laszlo Ersek
  2024-02-06  7:58 ` [edk2-devel] [PATCH v3 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg Wu, Jiaxin
       [not found] ` <03c101da659e$2ad5e530$8081af90$@byosoft.com.cn>
  2 siblings, 2 replies; 9+ messages in thread
From: Wu, Jiaxin @ 2024-02-06  7:58 UTC (permalink / raw)
  To: devel
  Cc: Ray Ni, Laszlo Ersek, Eric Dong, Zeng Star, Gerd Hoffmann,
	Rahul Kumar, Kinney Michael D

Use MAX_UINT32 directly instead of typecasting from signed
to unsigned value.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
index e988ce0542..71d6b0c6d8 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -694,14 +694,14 @@ BSPHandler (
   // Reset the tokens buffer.
   //
   ResetTokens ();
 
   //
-  // Reset BspIndex to -1, meaning BSP has not been elected.
+  // Reset BspIndex to MAX_UINT32, meaning BSP has not been elected.
   //
   if (FeaturePcdGet (PcdCpuSmmEnableBspElection)) {
-    mSmmMpSyncData->BspIndex = (UINT32)-1;
+    mSmmMpSyncData->BspIndex = MAX_UINT32;
   }
 
   //
   // Allow APs to check in from this point on
   //
@@ -745,11 +745,11 @@ APHandler (
 
   if (!(*mSmmMpSyncData->InsideSmm)) {
     //
     // BSP timeout in the first round
     //
-    if (mSmmMpSyncData->BspIndex != -1) {
+    if (mSmmMpSyncData->BspIndex != MAX_UINT32) {
       //
       // BSP Index is known
       // Existing AP is in SMI now but BSP not in, so, try bring BSP in SMM.
       //
       BspIndex = mSmmMpSyncData->BspIndex;
@@ -1654,11 +1654,11 @@ SmiRendezvous (
             //
             // Platform hook fails to determine, use default BSP election method
             //
             InterlockedCompareExchange32 (
               (UINT32 *)&mSmmMpSyncData->BspIndex,
-              (UINT32)-1,
+              MAX_UINT32,
               (UINT32)CpuIndex
               );
           }
         }
       }
@@ -1852,13 +1852,13 @@ InitializeMpSyncData (
     ZeroMem (mSmmMpSyncData, mSmmMpSyncDataSize);
     mSmmMpSyncData->CpuData      = (SMM_CPU_DATA_BLOCK *)((UINT8 *)mSmmMpSyncData + sizeof (SMM_DISPATCHER_MP_SYNC_DATA));
     mSmmMpSyncData->CandidateBsp = (BOOLEAN *)(mSmmMpSyncData->CpuData + gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus);
     if (FeaturePcdGet (PcdCpuSmmEnableBspElection)) {
       //
-      // Enable BSP election by setting BspIndex to -1
+      // Enable BSP election by setting BspIndex to MAX_UINT32
       //
-      mSmmMpSyncData->BspIndex = (UINT32)-1;
+      mSmmMpSyncData->BspIndex = MAX_UINT32;
     } else {
       //
       // Use NonSMM BSP as SMM BSP
       //
       for (CpuIndex = 0; CpuIndex < gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus; CpuIndex++) {
-- 
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115150): https://edk2.groups.io/g/devel/message/115150
Mute This Topic: https://groups.io/mt/104194205/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [edk2-devel] [PATCH v3 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg
  2024-02-06  7:58 [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization Wu, Jiaxin
  2024-02-06  7:58 ` [edk2-devel] [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting Wu, Jiaxin
@ 2024-02-06  7:58 ` Wu, Jiaxin
  2024-02-06  8:57   ` Ni, Ray
       [not found] ` <03c101da659e$2ad5e530$8081af90$@byosoft.com.cn>
  2 siblings, 1 reply; 9+ messages in thread
From: Wu, Jiaxin @ 2024-02-06  7:58 UTC (permalink / raw)
  To: devel
  Cc: Ray Ni, Laszlo Ersek, Eric Dong, Zeng Star, Gerd Hoffmann,
	Rahul Kumar, Kinney Michael D

This patch is to check BspIndex first before lock cmpxchg operation.
If BspIndex has not been set, then do the lock cmpxchg, otherwise,
the APs don't need to lock cmpxchg the BspIndex value since the BSP
election has been done. It's the optimization to lower the resource
contention caused by the atomic compare exchange operation, so as to
improve the SMI performance for BSP election.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Zeng Star <star.zeng@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
index 71d6b0c6d8..081f0c1501 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -1652,15 +1652,17 @@ SmiRendezvous (
             }
           } else {
             //
             // Platform hook fails to determine, use default BSP election method
             //
-            InterlockedCompareExchange32 (
-              (UINT32 *)&mSmmMpSyncData->BspIndex,
-              MAX_UINT32,
-              (UINT32)CpuIndex
-              );
+            if (mSmmMpSyncData->BspIndex == MAX_UINT32) {
+              InterlockedCompareExchange32 (
+                (UINT32 *)&mSmmMpSyncData->BspIndex,
+                MAX_UINT32,
+                (UINT32)CpuIndex
+                );
+            }
           }
         }
       }
 
       //
-- 
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115151): https://edk2.groups.io/g/devel/message/115151
Mute This Topic: https://groups.io/mt/104194206/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
  2024-02-06  7:58 ` [edk2-devel] [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting Wu, Jiaxin
@ 2024-02-06  8:56   ` Ni, Ray
  2024-02-06 14:33   ` Laszlo Ersek
  1 sibling, 0 replies; 9+ messages in thread
From: Ni, Ray @ 2024-02-06  8:56 UTC (permalink / raw)
  To: Wu, Jiaxin, devel@edk2.groups.io
  Cc: Laszlo Ersek, Dong, Eric, Zeng, Star, Gerd Hoffmann,
	Kumar, Rahul R, Kinney, Michael D

Reviewed-by: Ray Ni <ray.ni@intel.com>

Thanks,
Ray
> -----Original Message-----
> From: Wu, Jiaxin <jiaxin.wu@intel.com>
> Sent: Tuesday, February 6, 2024 3:58 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Dong, Eric
> <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com>; Gerd Hoffmann
> <kraxel@redhat.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Kinney,
> Michael D <michael.d.kinney@intel.com>
> Subject: [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex
> typecasting
> 
> Use MAX_UINT32 directly instead of typecasting from signed
> to unsigned value.
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Zeng Star <star.zeng@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Kinney Michael D <michael.d.kinney@intel.com>
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> index e988ce0542..71d6b0c6d8 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> @@ -694,14 +694,14 @@ BSPHandler (
>    // Reset the tokens buffer.
>    //
>    ResetTokens ();
> 
>    //
> -  // Reset BspIndex to -1, meaning BSP has not been elected.
> +  // Reset BspIndex to MAX_UINT32, meaning BSP has not been elected.
>    //
>    if (FeaturePcdGet (PcdCpuSmmEnableBspElection)) {
> -    mSmmMpSyncData->BspIndex = (UINT32)-1;
> +    mSmmMpSyncData->BspIndex = MAX_UINT32;
>    }
> 
>    //
>    // Allow APs to check in from this point on
>    //
> @@ -745,11 +745,11 @@ APHandler (
> 
>    if (!(*mSmmMpSyncData->InsideSmm)) {
>      //
>      // BSP timeout in the first round
>      //
> -    if (mSmmMpSyncData->BspIndex != -1) {
> +    if (mSmmMpSyncData->BspIndex != MAX_UINT32) {
>        //
>        // BSP Index is known
>        // Existing AP is in SMI now but BSP not in, so, try bring BSP in SMM.
>        //
>        BspIndex = mSmmMpSyncData->BspIndex;
> @@ -1654,11 +1654,11 @@ SmiRendezvous (
>              //
>              // Platform hook fails to determine, use default BSP election method
>              //
>              InterlockedCompareExchange32 (
>                (UINT32 *)&mSmmMpSyncData->BspIndex,
> -              (UINT32)-1,
> +              MAX_UINT32,
>                (UINT32)CpuIndex
>                );
>            }
>          }
>        }
> @@ -1852,13 +1852,13 @@ InitializeMpSyncData (
>      ZeroMem (mSmmMpSyncData, mSmmMpSyncDataSize);
>      mSmmMpSyncData->CpuData      = (SMM_CPU_DATA_BLOCK *)((UINT8
> *)mSmmMpSyncData + sizeof (SMM_DISPATCHER_MP_SYNC_DATA));
>      mSmmMpSyncData->CandidateBsp = (BOOLEAN *)(mSmmMpSyncData-
> >CpuData + gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus);
>      if (FeaturePcdGet (PcdCpuSmmEnableBspElection)) {
>        //
> -      // Enable BSP election by setting BspIndex to -1
> +      // Enable BSP election by setting BspIndex to MAX_UINT32
>        //
> -      mSmmMpSyncData->BspIndex = (UINT32)-1;
> +      mSmmMpSyncData->BspIndex = MAX_UINT32;
>      } else {
>        //
>        // Use NonSMM BSP as SMM BSP
>        //
>        for (CpuIndex = 0; CpuIndex < gSmmCpuPrivate-
> >SmmCoreEntryContext.NumberOfCpus; CpuIndex++) {
> --
> 2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115153): https://edk2.groups.io/g/devel/message/115153
Mute This Topic: https://groups.io/mt/104194205/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH v3 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg
  2024-02-06  7:58 ` [edk2-devel] [PATCH v3 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg Wu, Jiaxin
@ 2024-02-06  8:57   ` Ni, Ray
  0 siblings, 0 replies; 9+ messages in thread
From: Ni, Ray @ 2024-02-06  8:57 UTC (permalink / raw)
  To: Wu, Jiaxin, devel@edk2.groups.io
  Cc: Laszlo Ersek, Dong, Eric, Zeng, Star, Gerd Hoffmann,
	Kumar, Rahul R, Kinney, Michael D

Reviewed-by: Ray Ni <ray.ni@intel.com>

Thanks,
Ray
> -----Original Message-----
> From: Wu, Jiaxin <jiaxin.wu@intel.com>
> Sent: Tuesday, February 6, 2024 3:58 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Dong, Eric
> <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com>; Gerd Hoffmann
> <kraxel@redhat.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Kinney,
> Michael D <michael.d.kinney@intel.com>
> Subject: [PATCH v3 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex
> first before lock cmpxchg
> 
> This patch is to check BspIndex first before lock cmpxchg operation.
> If BspIndex has not been set, then do the lock cmpxchg, otherwise,
> the APs don't need to lock cmpxchg the BspIndex value since the BSP
> election has been done. It's the optimization to lower the resource
> contention caused by the atomic compare exchange operation, so as to
> improve the SMI performance for BSP election.
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Zeng Star <star.zeng@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Kinney Michael D <michael.d.kinney@intel.com>
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> index 71d6b0c6d8..081f0c1501 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> @@ -1652,15 +1652,17 @@ SmiRendezvous (
>              }
>            } else {
>              //
>              // Platform hook fails to determine, use default BSP election method
>              //
> -            InterlockedCompareExchange32 (
> -              (UINT32 *)&mSmmMpSyncData->BspIndex,
> -              MAX_UINT32,
> -              (UINT32)CpuIndex
> -              );
> +            if (mSmmMpSyncData->BspIndex == MAX_UINT32) {
> +              InterlockedCompareExchange32 (
> +                (UINT32 *)&mSmmMpSyncData->BspIndex,
> +                MAX_UINT32,
> +                (UINT32)CpuIndex
> +                );
> +            }
>            }
>          }
>        }
> 
>        //
> --
> 2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115154): https://edk2.groups.io/g/devel/message/115154
Mute This Topic: https://groups.io/mt/104194206/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
  2024-02-06  7:58 ` [edk2-devel] [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting Wu, Jiaxin
  2024-02-06  8:56   ` Ni, Ray
@ 2024-02-06 14:33   ` Laszlo Ersek
  1 sibling, 0 replies; 9+ messages in thread
From: Laszlo Ersek @ 2024-02-06 14:33 UTC (permalink / raw)
  To: Jiaxin Wu, devel
  Cc: Ray Ni, Eric Dong, Zeng Star, Gerd Hoffmann, Rahul Kumar,
	Kinney Michael D

On 2/6/24 08:58, Jiaxin Wu wrote:
> Use MAX_UINT32 directly instead of typecasting from signed
> to unsigned value.
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Zeng Star <star.zeng@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Kinney Michael D <michael.d.kinney@intel.com>
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> index e988ce0542..71d6b0c6d8 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> @@ -694,14 +694,14 @@ BSPHandler (
>    // Reset the tokens buffer.
>    //
>    ResetTokens ();
>  
>    //
> -  // Reset BspIndex to -1, meaning BSP has not been elected.
> +  // Reset BspIndex to MAX_UINT32, meaning BSP has not been elected.
>    //
>    if (FeaturePcdGet (PcdCpuSmmEnableBspElection)) {
> -    mSmmMpSyncData->BspIndex = (UINT32)-1;
> +    mSmmMpSyncData->BspIndex = MAX_UINT32;
>    }
>  
>    //
>    // Allow APs to check in from this point on
>    //
> @@ -745,11 +745,11 @@ APHandler (
>  
>    if (!(*mSmmMpSyncData->InsideSmm)) {
>      //
>      // BSP timeout in the first round
>      //
> -    if (mSmmMpSyncData->BspIndex != -1) {
> +    if (mSmmMpSyncData->BspIndex != MAX_UINT32) {
>        //
>        // BSP Index is known
>        // Existing AP is in SMI now but BSP not in, so, try bring BSP in SMM.
>        //
>        BspIndex = mSmmMpSyncData->BspIndex;
> @@ -1654,11 +1654,11 @@ SmiRendezvous (
>              //
>              // Platform hook fails to determine, use default BSP election method
>              //
>              InterlockedCompareExchange32 (
>                (UINT32 *)&mSmmMpSyncData->BspIndex,
> -              (UINT32)-1,
> +              MAX_UINT32,
>                (UINT32)CpuIndex
>                );
>            }
>          }
>        }
> @@ -1852,13 +1852,13 @@ InitializeMpSyncData (
>      ZeroMem (mSmmMpSyncData, mSmmMpSyncDataSize);
>      mSmmMpSyncData->CpuData      = (SMM_CPU_DATA_BLOCK *)((UINT8 *)mSmmMpSyncData + sizeof (SMM_DISPATCHER_MP_SYNC_DATA));
>      mSmmMpSyncData->CandidateBsp = (BOOLEAN *)(mSmmMpSyncData->CpuData + gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus);
>      if (FeaturePcdGet (PcdCpuSmmEnableBspElection)) {
>        //
> -      // Enable BSP election by setting BspIndex to -1
> +      // Enable BSP election by setting BspIndex to MAX_UINT32
>        //
> -      mSmmMpSyncData->BspIndex = (UINT32)-1;
> +      mSmmMpSyncData->BspIndex = MAX_UINT32;
>      } else {
>        //
>        // Use NonSMM BSP as SMM BSP
>        //
>        for (CpuIndex = 0; CpuIndex < gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus; CpuIndex++) {

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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115166): https://edk2.groups.io/g/devel/message/115166
Mute This Topic: https://groups.io/mt/104194205/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
       [not found] ` <03c101da659e$2ad5e530$8081af90$@byosoft.com.cn>
@ 2024-02-23  0:47   ` Wu, Jiaxin
  2024-02-23  5:36   ` Wu, Jiaxin
  1 sibling, 0 replies; 9+ messages in thread
From: Wu, Jiaxin @ 2024-02-23  0:47 UTC (permalink / raw)
  To: gaoliming, Kinney, Michael D; +Cc: devel@edk2.groups.io

Hi Mike, 

Could you help approval below 2 patches into the stable tag 202402? The patches have been merged.

UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg


Thanks,
Jiaxin 


> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Thursday, February 22, 2024 10:48 PM
> To: Wu, Jiaxin <jiaxin.wu@intel.com>
> 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 reply the mail in mail list and
> get the stewards approval. If this patch set is not to catch this stable
> tag, I will not include it in this stable tag.
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Wu, Jiaxin
> > 发送时间: 2024年2月6日 15:58
> > 收件人: devel@edk2.groups.io
> > 主题: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
> >
> > In V3 patch set, drop the patch to update the CheckFeatureSupported.
> >
> > The new patch set only focus on the BspIndex refinement.
> >
> > Jiaxin Wu (2):
> >   UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
> >   UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg
> >
> >  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 22 ++++++++++++----------
> >  1 file changed, 12 insertions(+), 10 deletions(-)
> >
> > --
> > 2.16.2.windows.1
> >
> >
> >
> > 
> >
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115862): https://edk2.groups.io/g/devel/message/115862
Mute This Topic: https://groups.io/mt/104194203/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
       [not found] ` <03c101da659e$2ad5e530$8081af90$@byosoft.com.cn>
  2024-02-23  0:47   ` [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization Wu, Jiaxin
@ 2024-02-23  5:36   ` Wu, Jiaxin
  2024-02-23  5:52     ` 回复: " gaoliming via groups.io
  1 sibling, 1 reply; 9+ messages in thread
From: Wu, Jiaxin @ 2024-02-23  5:36 UTC (permalink / raw)
  To: gaoliming, Kinney, Michael D, Zhang, Di, Li, Fei; +Cc: devel@edk2.groups.io

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 <gaoliming@byosoft.com.cn>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: devel@edk2.groups.io
> Subject: RE: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
> 
> Hi Mike,
> 
> Could you help approval below 2 patches into the stable tag 202402? The
> patches have been merged.
> 
> UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
> UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg
> 
> 
> Thanks,
> Jiaxin
> 
> 
> > -----Original Message-----
> > From: gaoliming <gaoliming@byosoft.com.cn>
> > Sent: Thursday, February 22, 2024 10:48 PM
> > To: Wu, Jiaxin <jiaxin.wu@intel.com>
> > 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 reply the mail in mail list and
> > get the stewards approval. If this patch set is not to catch this stable
> > tag, I will not include it in this stable tag.
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Wu, Jiaxin
> > > 发送时间: 2024年2月6日 15:58
> > > 收件人: devel@edk2.groups.io
> > > 主题: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
> > >
> > > In V3 patch set, drop the patch to update the CheckFeatureSupported.
> > >
> > > The new patch set only focus on the BspIndex refinement.
> > >
> > > Jiaxin Wu (2):
> > >   UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
> > >   UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock
> cmpxchg
> > >
> > >  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 22 ++++++++++++--------
> --
> > >  1 file changed, 12 insertions(+), 10 deletions(-)
> > >
> > > --
> > > 2.16.2.windows.1
> > >
> > >
> > >
> > > 
> > >
> >
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115867): https://edk2.groups.io/g/devel/message/115867
Mute This Topic: https://groups.io/mt/104194203/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

* 回复: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
  2024-02-23  5:36   ` Wu, Jiaxin
@ 2024-02-23  5:52     ` gaoliming via groups.io
  0 siblings, 0 replies; 9+ messages in thread
From: gaoliming via groups.io @ 2024-02-23  5:52 UTC (permalink / raw)
  To: devel, jiaxin.wu, 'Kinney, Michael D',
	'Zhang, Di', 'Li, Fei'

Jiaxin:
  Thanks for your confirmation. Edk2 202402 stable tag will not include
them. 

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Wu, Jiaxin
> 发送时间: 2024年2月23日 13:36
> 收件人: gaoliming <gaoliming@byosoft.com.cn>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Zhang, Di <di.zhang@intel.com>; Li, Fei
> <fei.li@intel.com>
> 抄送: devel@edk2.groups.io
> 主题: Re: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
> 
> 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 <gaoliming@byosoft.com.cn>; Kinney, Michael D
> > <michael.d.kinney@intel.com>
> > Cc: devel@edk2.groups.io
> > Subject: RE: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
> >
> > Hi Mike,
> >
> > Could you help approval below 2 patches into the stable tag 202402? The
> > patches have been merged.
> >
> > UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
> > UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg
> >
> >
> > Thanks,
> > Jiaxin
> >
> >
> > > -----Original Message-----
> > > From: gaoliming <gaoliming@byosoft.com.cn>
> > > Sent: Thursday, February 22, 2024 10:48 PM
> > > To: Wu, Jiaxin <jiaxin.wu@intel.com>
> > > 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 reply the mail in mail
list and
> > > get the stewards approval. If this patch set is not to catch this
stable
> > > tag, I will not include it in this stable tag.
> > >
> > > Thanks
> > > Liming
> > > > -----邮件原件-----
> > > > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Wu,
> Jiaxin
> > > > 发送时间: 2024年2月6日 15:58
> > > > 收件人: devel@edk2.groups.io
> > > > 主题: [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization
> > > >
> > > > In V3 patch set, drop the patch to update the CheckFeatureSupported.
> > > >
> > > > The new patch set only focus on the BspIndex refinement.
> > > >
> > > > Jiaxin Wu (2):
> > > >   UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting
> > > >   UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock
> > cmpxchg
> > > >
> > > >  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 22
> ++++++++++++--------
> > --
> > > >  1 file changed, 12 insertions(+), 10 deletions(-)
> > > >
> > > > --
> > > > 2.16.2.windows.1
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115868): https://edk2.groups.io/g/devel/message/115868
Mute This Topic: https://groups.io/mt/104523832/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-23  5:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-06  7:58 [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization Wu, Jiaxin
2024-02-06  7:58 ` [edk2-devel] [PATCH v3 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid BspIndex typecasting Wu, Jiaxin
2024-02-06  8:56   ` Ni, Ray
2024-02-06 14:33   ` Laszlo Ersek
2024-02-06  7:58 ` [edk2-devel] [PATCH v3 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg Wu, Jiaxin
2024-02-06  8:57   ` Ni, Ray
     [not found] ` <03c101da659e$2ad5e530$8081af90$@byosoft.com.cn>
2024-02-23  0:47   ` [edk2-devel] [PATCH v3 0/2] SMM CPU Optimization Wu, Jiaxin
2024-02-23  5:36   ` Wu, Jiaxin
2024-02-23  5:52     ` 回复: " gaoliming via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox