From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org 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 A2DDE2118A5AD for ; Mon, 12 Nov 2018 02:30:16 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 293E288E4F; Mon, 12 Nov 2018 10:30:16 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-236.rdu2.redhat.com [10.10.120.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 975AB1974D; Mon, 12 Nov 2018 10:30:14 +0000 (UTC) To: "Dong, Eric" , "Kinney, Michael D" , "edk2-devel@lists.01.org" , "afish@apple.com" , Leif Lindholm Cc: "Ni, Ruiyu" References: <20181108025800.12112-1-eric.dong@intel.com> From: Laszlo Ersek Message-ID: <894fecc5-1cc0-d1d0-0252-2347f4db10a4@redhat.com> Date: Mon, 12 Nov 2018 11:30:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 12 Nov 2018 10:30:16 +0000 (UTC) Subject: Re: [Patch 0/2] Separate semaphore container. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 10:30:16 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/10/18 04:19, Dong, Eric wrote: > Hi Stewards: > > Since this is a bug fix, and the risk for this release is small. I plan to push this serial changes before edk2-stable201811 tag. > > If you have any concern, please raise here. I'm fine with pushing this, as I explained elsewhere in this thread: https://www.mail-archive.com/edk2-devel@lists.01.org/msg46898.html "Also this looks like a bugfix to a new feature already committed in this development cycle, so I think it may go in during the hard feature freeze." Thanks Laszlo >> -----Original Message----- >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Eric >> Dong >> Sent: Thursday, November 8, 2018 10:58 AM >> To: edk2-devel@lists.01.org >> Cc: Ni, Ruiyu ; Laszlo Ersek >> Subject: [edk2] [Patch 0/2] Separate semaphore container. >> >> In current implementation, core level semaphore use same container with >> package level semaphore. This design will let the core level semaphore not >> works as expected in below case: >> 1. Feature A has CPU_FEATURE_CORE_BEFORE dependence with Feature B. >> 2. Feature C has CPU_FEATURE_PACKAGE_AFTER dependence with Feature B. >> in this case an core level semaphore will be add between A and B, and an >> package level semaphore will be add between B and C. >> >> For a CPU has one package, two cores and 4 threads. Execute like below: >> >> Thread 1 Thread 2 ..... Thread 4 >> ReleaseSemaph(1,2) -| >> WaitForSemaph(1(2)) -|<-----------------------These two are Core Semaph >> ReleaseSemaph(1,2) -| >> WaitForSemaph(2) -| <--- Core Semaph >> >> ReleaseSemaph (1,2,3,4) -| >> WaitForSemaph (1(4)) -| <---------------- Package Semaph >> >> ReleaseSemaph(3,4) >> WaitForSemaph(4(2)) <- Core Semaph >> >> In above case, for thread 4, when it executes a core semaphore, i will found >> WaitForSemaph(4(2)) is met because Thread 1 has execute a package >> semaphore and ReleaseSemaph(4) for it before. This is not an expect behavior. >> Thread 4 should wait for thread 3 to do this. >> >> Fix this issue by separate the semaphore container for core level and package >> level. >> >> Cc: Laszlo Ersek >> Cc: Ruiyu Ni >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Eric Dong >> >> Eric Dong (2): >> UefiCpuPkg/RegisterCpuFeaturesLib: Separate semaphore container. >> UefiCpuPkg/PiSmmCpuDxeSmm: Separate semaphore container. >> >> .../RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 9 ++++++--- >> .../RegisterCpuFeaturesLib/RegisterCpuFeatures.h | 7 ++++--- >> UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 21 ++++++++++++++------- >> 3 files changed, 24 insertions(+), 13 deletions(-) >> >> -- >> 2.15.0.windows.1 >> >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel