From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1EB1A21954084 for ; Mon, 24 Apr 2017 17:54:32 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2017 17:54:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,247,1488873600"; d="scan'208";a="1139684918" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 24 Apr 2017 17:54:31 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 24 Apr 2017 17:54:31 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 24 Apr 2017 17:54:25 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.193]) with mapi id 14.03.0319.002; Tue, 25 Apr 2017 08:54:24 +0800 From: "Fan, Jeff" To: Laszlo Ersek , "edk2-devel@lists.01.org" CC: "Wu, Hao A" , "Kinney, Michael D" , "Tian, Feng" Thread-Topic: [edk2] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Lock should be acquired Thread-Index: AQHSt+nOg3J4edEWJkCsIgcc2yIzg6HT6WmAgAFhijA= Date: Tue, 25 Apr 2017 00:54:23 +0000 Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4C5AD616@shsmsx102.ccr.corp.intel.com> References: <20170418021606.8776-1-jeff.fan@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDIxMTNlNmQtNGE0NC00MTY4LWI0Y2EtMzY1Njg2MDgzM2EzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkpKRWlSWFQ1WnZGWEhGWTdpSWk4VEVxNDJ4V1Z2cWJCblpKR3FESEl0Nkk9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Lock should be acquired X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2017 00:54:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Laszlo, There is no any real issue we encountered. Some static code check tool reported AcquireSpinLockOrFai() return value wa= s not been checked. Then I found we may ignore some issue if AcquireSpinLockOrFai() return FALS= E (even it will not be happened). Using AcquireSpinLock() is due to the following code are using AcquireSpinL= ock() to check AP's BUSY state also. Thanks! Jeff -----Original Message----- From: Laszlo Ersek [mailto:lersek@redhat.com]=20 Sent: Monday, April 24, 2017 7:41 PM To: Fan, Jeff; edk2-devel@lists.01.org Cc: Wu, Hao A; Kinney, Michael D; Tian, Feng Subject: Re: [edk2] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Lock should be acqui= red Hi Jeff, On 04/18/17 04:16, Jeff Fan wrote: > SMM BSP's *busy* state should be acquired. We could use=20 > AcquireSpinLock() instead of AcquireSpinLockOrFail(). >=20 > Cc: Hao Wu > Cc: Feng Tian > Cc: Michael Kinney > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jeff Fan > --- > UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c=20 > b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > index a1d16b4..e03f1e0 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > @@ -407,7 +407,7 @@ BSPHandler ( > // > // The BUSY lock is initialized to Acquired state > // > - AcquireSpinLockOrFail (mSmmMpSyncData->CpuData[CpuIndex].Busy); > + AcquireSpinLock (mSmmMpSyncData->CpuData[CpuIndex].Busy); > =20 > // > // Perform the pre tasks >=20 what symptoms did you experience without the fix? Thanks Laszlo