From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 201E920D7A3B9 for ; Tue, 25 Apr 2017 08:09:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F2FA3B71E; Tue, 25 Apr 2017 15:09:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5F2FA3B71E Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5F2FA3B71E Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-19.phx2.redhat.com [10.3.116.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3026F17BA3; Tue, 25 Apr 2017 15:09:14 +0000 (UTC) To: "Fan, Jeff" , "edk2-devel@lists.01.org" References: <20170418021606.8776-1-jeff.fan@intel.com> <542CF652F8836A4AB8DBFAAD40ED192A4C5AD616@shsmsx102.ccr.corp.intel.com> Cc: "Wu, Hao A" , "Kinney, Michael D" , "Tian, Feng" From: Laszlo Ersek Message-ID: Date: Tue, 25 Apr 2017 17:09:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <542CF652F8836A4AB8DBFAAD40ED192A4C5AD616@shsmsx102.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Apr 2017 15:09:15 +0000 (UTC) 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 15:09:16 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 04/25/17 02:54, Fan, Jeff wrote: > Laszlo, > > There is no any real issue we encountered. > > Some static code check tool reported AcquireSpinLockOrFai() return value was not been checked. > Then I found we may ignore some issue if AcquireSpinLockOrFai() return FALSE (even it will not be happened). > > Using AcquireSpinLock() is due to the following code are using AcquireSpinLock() to check AP's BUSY state also. Thanks for the explanation! Laszlo > > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > 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 acquired > > Hi Jeff, > > On 04/18/17 04:16, Jeff Fan wrote: >> SMM BSP's *busy* state should be acquired. We could use >> AcquireSpinLock() instead of AcquireSpinLockOrFail(). >> >> 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(-) >> >> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c >> 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); >> >> // >> // Perform the pre tasks >> > > what symptoms did you experience without the fix? > > Thanks > Laszlo >