[edk2-devel] [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens.

Ni, Ray ray.ni at intel.com
Fri Apr 10 07:08:32 UTC 2020


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

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Dong, Eric
> Sent: Friday, April 10, 2020 2:54 PM
> To: devel at edk2.groups.io
> Cc: Ni, Ray <ray.ni at intel.com>; Zeng, Star <star.zeng at intel.com>; Laszlo Ersek <lersek at redhat.com>
> Subject: [edk2-devel] [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2388
> 
> 
> After remove Used parameter, below code in ResetTokens can also be
> removed:
> 1. The RunningApCount parameter will be reset in GetFreeToken.
> 2. The ReleaseSpinLock should be called in ReleaseToken function,
>    Code in this function seems like a later fix if ReleaseToken not
>    Release it. We should remove code here and fix the real issue if
>    existed.
> 
> Signed-off-by: Eric Dong <eric.dong at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Star Zeng <star.zeng at intel.com>
> Cc: Laszlo Ersek <lersek at redhat.com>
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 20 --------------------
>  1 file changed, 20 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> index 305bffa9bc..57e788c01b 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> @@ -433,26 +433,6 @@ ResetTokens (
>    VOID
> 
>    )
> 
>  {
> 
> -  LIST_ENTRY            *Link;
> 
> -  PROCEDURE_TOKEN       *ProcToken;
> 
> -
> 
> -  Link = GetFirstNode (&gSmmCpuPrivate->TokenList);
> 
> -  while (!IsNull (&gSmmCpuPrivate->TokenList, Link)) {
> 
> -    ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);
> 
> -
> 
> -    ProcToken->RunningApCount = 0;
> 
> -
> 
> -    //
> 
> -    // Check the spinlock status and release it if not released yet.
> 
> -    //
> 
> -    if (!AcquireSpinLockOrFail(ProcToken->SpinLock)) {
> 
> -      DEBUG((DEBUG_ERROR, "Risk::SpinLock still not released!"));
> 
> -    }
> 
> -    ReleaseSpinLock (ProcToken->SpinLock);
> 
> -
> 
> -    Link = GetNextNode (&gSmmCpuPrivate->TokenList, Link);
> 
> -  }
> 
> -
> 
>    //
> 
>    // Reset the FirstFreeToken to the beginning of token list upon exiting SMI.
> 
>    //
> 
> --
> 2.23.0.windows.1
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> 
> View/Reply Online (#57184): https://edk2.groups.io/g/devel/message/57184
> Mute This Topic: https://groups.io/mt/72915832/1712937
> Group Owner: devel+owner at edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub  [ray.ni at intel.com]
> -=-=-=-=-=-=


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57186): https://edk2.groups.io/g/devel/message/57186
Mute This Topic: https://groups.io/mt/72915832/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list