From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.4621.1586502516570488798 for ; Fri, 10 Apr 2020 00:08:36 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: ray.ni@intel.com) IronPort-SDR: 5HHkvzeUSSilEyYi2/hZp7+15OT0yHUjw1xIdo7tWawOZwo+Sk1YCodoNd4+iwN8plG+LvT/ei fMxAa40fhiBQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2020 00:08:35 -0700 IronPort-SDR: Qepn7H8Ojg94aqqXxGM7WqshzgbRCVLix5NMXcLPzFKlRGVGm0DtVyh6LAFKIUBWBbxAUHKDkz kdOXWy/V1Jqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,364,1580803200"; d="scan'208";a="240871695" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 10 Apr 2020 00:08:35 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 10 Apr 2020 00:08:35 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 10 Apr 2020 00:08:35 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.225]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.214]) with mapi id 14.03.0439.000; Fri, 10 Apr 2020 15:08:33 +0800 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Dong, Eric" CC: "Zeng, Star" , Laszlo Ersek Subject: Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens. Thread-Topic: [edk2-devel] [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove useless code in ResetTokens. Thread-Index: AQHWDwTg6YtzsmSIaE6L33TsRgiS8qhx75nw Date: Fri, 10 Apr 2020 07:08:32 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C4E476B@SHSMSX104.ccr.corp.intel.com> References: <20200410065401.966-1-eric.dong@intel.com> <20200410065401.966-3-eric.dong@intel.com> In-Reply-To: <20200410065401.966-3-eric.dong@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Dong, Eric > Sent: Friday, April 10, 2020 2:54 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Zeng, Star ; Laszlo = Ersek > Subject: [edk2-devel] [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove usele= ss code in ResetTokens. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2388 >=20 >=20 > 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. >=20 > Signed-off-by: Eric Dong > Cc: Ray Ni > Cc: Star Zeng > Cc: Laszlo Ersek > --- > UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 20 -------------------- > 1 file changed, 20 deletions(-) >=20 > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuD= xeSmm/MpService.c > index 305bffa9bc..57e788c01b 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > @@ -433,26 +433,6 @@ ResetTokens ( > VOID >=20 > ) >=20 > { >=20 > - LIST_ENTRY *Link; >=20 > - PROCEDURE_TOKEN *ProcToken; >=20 > - >=20 > - Link =3D GetFirstNode (&gSmmCpuPrivate->TokenList); >=20 > - while (!IsNull (&gSmmCpuPrivate->TokenList, Link)) { >=20 > - ProcToken =3D PROCEDURE_TOKEN_FROM_LINK (Link); >=20 > - >=20 > - ProcToken->RunningApCount =3D 0; >=20 > - >=20 > - // >=20 > - // Check the spinlock status and release it if not released yet. >=20 > - // >=20 > - if (!AcquireSpinLockOrFail(ProcToken->SpinLock)) { >=20 > - DEBUG((DEBUG_ERROR, "Risk::SpinLock still not released!")); >=20 > - } >=20 > - ReleaseSpinLock (ProcToken->SpinLock); >=20 > - >=20 > - Link =3D GetNextNode (&gSmmCpuPrivate->TokenList, Link); >=20 > - } >=20 > - >=20 > // >=20 > // Reset the FirstFreeToken to the beginning of token list upon exitin= g SMI. >=20 > // >=20 > -- > 2.23.0.windows.1 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > 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@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D