]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens.
authorDong, Eric <eric.dong@intel.com>
Fri, 10 Apr 2020 06:54:01 +0000 (14:54 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 13 Apr 2020 03:13:36 +0000 (03:13 +0000)
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@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c

index 305bffa9bcfd1645e1ddee4ea71b4311dfb7ed11..57e788c01b1f5707373697accf6235a5df437b76 100644 (file)
@@ -433,26 +433,6 @@ ResetTokens (
   VOID\r
   )\r
 {\r
-  LIST_ENTRY            *Link;\r
-  PROCEDURE_TOKEN       *ProcToken;\r
-\r
-  Link = GetFirstNode (&gSmmCpuPrivate->TokenList);\r
-  while (!IsNull (&gSmmCpuPrivate->TokenList, Link)) {\r
-    ProcToken = PROCEDURE_TOKEN_FROM_LINK (Link);\r
-\r
-    ProcToken->RunningApCount = 0;\r
-\r
-    //\r
-    // Check the spinlock status and release it if not released yet.\r
-    //\r
-    if (!AcquireSpinLockOrFail(ProcToken->SpinLock)) {\r
-      DEBUG((DEBUG_ERROR, "Risk::SpinLock still not released!"));\r
-    }\r
-    ReleaseSpinLock (ProcToken->SpinLock);\r
-\r
-    Link = GetNextNode (&gSmmCpuPrivate->TokenList, Link);\r
-  }\r
-\r
   //\r
   // Reset the FirstFreeToken to the beginning of token list upon exiting SMI.\r
   //\r