* [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous()
@ 2023-05-10 8:38 Li, Zhihao
2023-05-10 8:42 ` Ni, Ray
0 siblings, 1 reply; 3+ messages in thread
From: Li, Zhihao @ 2023-05-10 8:38 UTC (permalink / raw)
To: devel; +Cc: Eric Dong, Ray Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4431
In Ap relaxed mode, some SMI handlers should call SmmWaitForApArrival() to let all ap arrive in SmmCpuRendezvous(). But in traditional mode, these SMI handlers don't need to call SmmWaitForApArrival() again. So it need to be check cpu sync mode before calling SmmWaitForApArrival().
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhihao Li <zhihao.li@intel.com>
---
UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
index 2ebf4543c3ed..391b64e9f222 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
@@ -1,7 +1,7 @@
/** @file
Implementation of SMM CPU Services Protocol.
-Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -421,11 +421,18 @@ SmmCpuRendezvous (
goto ON_EXIT;
}
- //
- // There are some APs outside SMM, Wait for all avaiable APs to arrive.
- //
- SmmWaitForApArrival ();
- Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : EFI_TIMEOUT;
+ if ((mSmmMpSyncData->EffectiveSyncMode != SmmCpuSyncModeTradition) && !SmmCpuFeaturesNeedConfigureMtrrs ()) {
+ //
+ // There are some APs outside SMM, Wait for all avaiable APs to arrive.
+ //
+ SmmWaitForApArrival ();
+ Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : EFI_TIMEOUT;
+ } else {
+ //
+ // BSP has already waitted for APs to arrive SMM if SmmCpuSyncMode selected or need config MTRR.
+ //
+ Status = EFI_TIMEOUT;
+ }
ON_EXIT:
if (!mSmmMpSyncData->AllApArrivedWithException) {
--
2.26.2.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous()
2023-05-10 8:38 [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous() Li, Zhihao
@ 2023-05-10 8:42 ` Ni, Ray
2023-05-31 15:24 ` [edk2-devel] " Wu, Jiaxin
0 siblings, 1 reply; 3+ messages in thread
From: Ni, Ray @ 2023-05-10 8:42 UTC (permalink / raw)
To: Li, Zhihao, devel@edk2.groups.io; +Cc: Dong, Eric
Reviewed-by: Ray Ni <ray.ni@intel.com>
> -----Original Message-----
> From: Li, Zhihao <zhihao.li@intel.com>
> Sent: Wednesday, May 10, 2023 4:38 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in
> SmmCpuRendezvous()
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4431
>
> In Ap relaxed mode, some SMI handlers should call SmmWaitForApArrival() to let
> all ap arrive in SmmCpuRendezvous(). But in traditional mode, these SMI
> handlers don't need to call SmmWaitForApArrival() again. So it need to be check
> cpu sync mode before calling SmmWaitForApArrival().
>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
>
> Signed-off-by: Zhihao Li <zhihao.li@intel.com>
> ---
> UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> index 2ebf4543c3ed..391b64e9f222 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> @@ -1,7 +1,7 @@
> /** @file
>
> Implementation of SMM CPU Services Protocol.
>
>
>
> -Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
>
> +Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
>
>
> **/
>
> @@ -421,11 +421,18 @@ SmmCpuRendezvous (
> goto ON_EXIT;
>
> }
>
>
>
> - //
>
> - // There are some APs outside SMM, Wait for all avaiable APs to arrive.
>
> - //
>
> - SmmWaitForApArrival ();
>
> - Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS :
> EFI_TIMEOUT;
>
> + if ((mSmmMpSyncData->EffectiveSyncMode != SmmCpuSyncModeTradition)
> && !SmmCpuFeaturesNeedConfigureMtrrs ()) {
>
> + //
>
> + // There are some APs outside SMM, Wait for all avaiable APs to arrive.
>
> + //
>
> + SmmWaitForApArrival ();
>
> + Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS :
> EFI_TIMEOUT;
>
> + } else {
>
> + //
>
> + // BSP has already waitted for APs to arrive SMM if SmmCpuSyncMode
> selected or need config MTRR.
>
> + //
>
> + Status = EFI_TIMEOUT;
>
> + }
>
>
>
> ON_EXIT:
>
> if (!mSmmMpSyncData->AllApArrivedWithException) {
>
> --
> 2.26.2.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous()
2023-05-10 8:42 ` Ni, Ray
@ 2023-05-31 15:24 ` Wu, Jiaxin
0 siblings, 0 replies; 3+ messages in thread
From: Wu, Jiaxin @ 2023-05-31 15:24 UTC (permalink / raw)
To: devel@edk2.groups.io, Ni, Ray, Li, Zhihao; +Cc: Dong, Eric
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray
> Sent: Wednesday, May 10, 2023 4:42 PM
> To: Li, Zhihao <zhihao.li@intel.com>; devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>
> Subject: Re: [edk2-devel] [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check
> cpu sync mode in SmmCpuRendezvous()
>
> Reviewed-by: Ray Ni <ray.ni@intel.com>
>
> > -----Original Message-----
> > From: Li, Zhihao <zhihao.li@intel.com>
> > Sent: Wednesday, May 10, 2023 4:38 PM
> > To: devel@edk2.groups.io
> > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
> > Subject: [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in
> > SmmCpuRendezvous()
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4431
> >
> > In Ap relaxed mode, some SMI handlers should call SmmWaitForApArrival()
> to let
> > all ap arrive in SmmCpuRendezvous(). But in traditional mode, these SMI
> > handlers don't need to call SmmWaitForApArrival() again. So it need to be
> check
> > cpu sync mode before calling SmmWaitForApArrival().
> >
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> >
> > Signed-off-by: Zhihao Li <zhihao.li@intel.com>
> > ---
> > UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 19 +++++++++++++------
> > 1 file changed, 13 insertions(+), 6 deletions(-)
> >
> > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> > b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> > index 2ebf4543c3ed..391b64e9f222 100644
> > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> > @@ -1,7 +1,7 @@
> > /** @file
> >
> > Implementation of SMM CPU Services Protocol.
> >
> >
> >
> > -Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
> >
> > +Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.<BR>
> >
> > SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >
> >
> > **/
> >
> > @@ -421,11 +421,18 @@ SmmCpuRendezvous (
> > goto ON_EXIT;
> >
> > }
> >
> >
> >
> > - //
> >
> > - // There are some APs outside SMM, Wait for all avaiable APs to arrive.
> >
> > - //
> >
> > - SmmWaitForApArrival ();
> >
> > - Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS :
> > EFI_TIMEOUT;
> >
> > + if ((mSmmMpSyncData->EffectiveSyncMode !=
> SmmCpuSyncModeTradition)
> > && !SmmCpuFeaturesNeedConfigureMtrrs ()) {
> >
> > + //
> >
> > + // There are some APs outside SMM, Wait for all avaiable APs to arrive.
> >
> > + //
> >
> > + SmmWaitForApArrival ();
> >
> > + Status = mSmmMpSyncData->AllApArrivedWithException ?
> EFI_SUCCESS :
> > EFI_TIMEOUT;
> >
> > + } else {
> >
> > + //
> >
> > + // BSP has already waitted for APs to arrive SMM if SmmCpuSyncMode
> > selected or need config MTRR.
> >
> > + //
> >
> > + Status = EFI_TIMEOUT;
> >
> > + }
> >
> >
> >
> > ON_EXIT:
> >
> > if (!mSmmMpSyncData->AllApArrivedWithException) {
> >
> > --
> > 2.26.2.windows.1
>
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-31 15:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10 8:38 [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous() Li, Zhihao
2023-05-10 8:42 ` Ni, Ray
2023-05-31 15:24 ` [edk2-devel] " Wu, Jiaxin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox