From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com []) by mx.groups.io with SMTP id smtpd.web11.4523.1586501644904125037 for ; Thu, 09 Apr 2020 23:54:07 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: eric.dong@intel.com) IronPort-SDR: nJ73lhXjc+DCY8MY35m3+uma8sXUXmEbiOp01wLEevD20lDZgpsTTCptQcJ9f3XR0qL3/tKmX6 AKTYfp6e6u0g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2020 23:54:07 -0700 IronPort-SDR: h4pyvtTLzk3KWXI1qDSHmRQk3QVXqrzJ6Vq1gGoP9/AilrMxKy6rHF1LfWpMxy/OS53BMg/Xlv F9NoLopXAiGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,364,1580803200"; d="scan'208";a="453423346" Received: from ydong10-desktop.ccr.corp.intel.com ([10.239.158.133]) by fmsmga006.fm.intel.com with ESMTP; 09 Apr 2020 23:54:04 -0700 From: "Dong, Eric" To: devel@edk2.groups.io Cc: Ray Ni , Star Zeng , Laszlo Ersek Subject: [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens. Date: Fri, 10 Apr 2020 14:54:01 +0800 Message-Id: <20200410065401.966-3-eric.dong@intel.com> X-Mailer: git-send-email 2.23.0.windows.1 In-Reply-To: <20200410065401.966-1-eric.dong@intel.com> References: <20200410065401.966-1-eric.dong@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2388=0D 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 Cc: Ray Ni Cc: Star Zeng Cc: Laszlo Ersek --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxe= Smm/MpService.c index 305bffa9bc..57e788c01b 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -433,26 +433,6 @@ ResetTokens ( VOID=0D )=0D {=0D - LIST_ENTRY *Link;=0D - PROCEDURE_TOKEN *ProcToken;=0D -=0D - Link =3D GetFirstNode (&gSmmCpuPrivate->TokenList);=0D - while (!IsNull (&gSmmCpuPrivate->TokenList, Link)) {=0D - ProcToken =3D PROCEDURE_TOKEN_FROM_LINK (Link);=0D -=0D - ProcToken->RunningApCount =3D 0;=0D -=0D - //=0D - // Check the spinlock status and release it if not released yet.=0D - //=0D - if (!AcquireSpinLockOrFail(ProcToken->SpinLock)) {=0D - DEBUG((DEBUG_ERROR, "Risk::SpinLock still not released!"));=0D - }=0D - ReleaseSpinLock (ProcToken->SpinLock);=0D -=0D - Link =3D GetNextNode (&gSmmCpuPrivate->TokenList, Link);=0D - }=0D -=0D //=0D // Reset the FirstFreeToken to the beginning of token list upon exiting = SMI.=0D //=0D --=20 2.23.0.windows.1