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:06 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: eric.dong@intel.com) IronPort-SDR: Ps34UETgsfg6bIv1S7vusVT9jpM+9RO20aLftcnpCf4VHL5JHC3KsSJP29Tc1p7Mf8ZaQP4Xal 3hEvb2we3eiA== 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:06 -0700 IronPort-SDR: DkT1540kx9LbwZZlTi/5XLp1ThrX6Lnc/4hksQNXRU2hxH6F/+SuuFAyn+6wNoKrsT+YQk4ASS /dtJGXnfO6Ng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,364,1580803200"; d="scan'208";a="453423328" Received: from ydong10-desktop.ccr.corp.intel.com ([10.239.158.133]) by fmsmga006.fm.intel.com with ESMTP; 09 Apr 2020 23:54:03 -0700 From: "Dong, Eric" To: devel@edk2.groups.io Cc: Ray Ni , Star Zeng , Laszlo Ersek Subject: [PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: Remove Used parameter. Date: Fri, 10 Apr 2020 14:54:00 +0800 Message-Id: <20200410065401.966-2-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 patch "UefiCpuPkg/PiSmmCpuDxeSmm: Improve the performance of GetFreeToken()" which adds new parameter FirstFreeToken, it's not need to use Uses parameter. This patch used to remove this parameter. Signed-off-by: Eric Dong Cc: Ray Ni Cc: Star Zeng Cc: Laszlo Ersek --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 10 +++++----- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxe= Smm/MpService.c index 93cac5e4fa..305bffa9bc 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -441,7 +441,6 @@ ResetTokens ( ProcToken =3D PROCEDURE_TOKEN_FROM_LINK (Link);=0D =0D ProcToken->RunningApCount =3D 0;=0D - ProcToken->Used =3D FALSE;=0D =0D //=0D // Check the spinlock status and release it if not released yet.=0D @@ -1049,10 +1048,13 @@ IsTokenInUse ( }=0D =0D Link =3D GetFirstNode (&gSmmCpuPrivate->TokenList);=0D - while (!IsNull (&gSmmCpuPrivate->TokenList, Link)) {=0D + //=0D + // Only search used tokens.=0D + //=0D + while (Link !=3D gSmmCpuPrivate->FirstFreeToken) {=0D ProcToken =3D PROCEDURE_TOKEN_FROM_LINK (Link);=0D =0D - if (ProcToken->Used && ProcToken->SpinLock =3D=3D Token) {=0D + if (ProcToken->SpinLock =3D=3D Token) {=0D return TRUE;=0D }=0D =0D @@ -1104,7 +1106,6 @@ AllocateTokenBuffer ( =0D ProcTokens[Index].Signature =3D PROCEDURE_TOKEN_SIGNATURE;=0D ProcTokens[Index].SpinLock =3D SpinLock;=0D - ProcTokens[Index].Used =3D FALSE;=0D ProcTokens[Index].RunningApCount =3D 0;=0D =0D InsertTailList (&gSmmCpuPrivate->TokenList, &ProcTokens[Index].Link);= =0D @@ -1140,7 +1141,6 @@ GetFreeToken ( NewToken =3D PROCEDURE_TOKEN_FROM_LINK (gSmmCpuPrivate->FirstFreeToken);= =0D gSmmCpuPrivate->FirstFreeToken =3D GetNextNode (&gSmmCpuPrivate->TokenLi= st, gSmmCpuPrivate->FirstFreeToken);=0D =0D - NewToken->Used =3D TRUE;=0D NewToken->RunningApCount =3D RunningApsCount;=0D AcquireSpinLock (NewToken->SpinLock);=0D =0D diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h b/UefiCpuPkg/PiSmmC= puDxeSmm/PiSmmCpuDxeSmm.h index c9b3b739f3..7fb3a2d9e4 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h @@ -214,7 +214,6 @@ typedef struct { =0D SPIN_LOCK *SpinLock;=0D volatile UINT32 RunningApCount;=0D - BOOLEAN Used;=0D } PROCEDURE_TOKEN;=0D =0D #define PROCEDURE_TOKEN_FROM_LINK(a) CR (a, PROCEDURE_TOKEN, Link, PROCED= URE_TOKEN_SIGNATURE)=0D --=20 2.23.0.windows.1