From: Laszlo Ersek <lersek@redhat.com>
To: "Dong, Eric" <eric.dong@intel.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
"afish@apple.com" <afish@apple.com>,
Leif Lindholm <leif.lindholm@linaro.org>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>
Subject: Re: [Patch 0/2] Separate semaphore container.
Date: Mon, 12 Nov 2018 11:30:13 +0100 [thread overview]
Message-ID: <894fecc5-1cc0-d1d0-0252-2347f4db10a4@redhat.com> (raw)
In-Reply-To: <ED077930C258884BBCB450DB737E662259D3B5EC@shsmsx102.ccr.corp.intel.com>
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 <ruiyu.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>
>> 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 <lersek@redhat.com>
>> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Eric Dong <eric.dong@intel.com>
>>
>> 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
prev parent reply other threads:[~2018-11-12 10:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-08 2:57 [Patch 0/2] Separate semaphore container Eric Dong
2018-11-08 2:57 ` [Patch 1/2] UefiCpuPkg/RegisterCpuFeaturesLib: " Eric Dong
2018-11-09 8:40 ` Ni, Ruiyu
2018-11-08 2:58 ` [Patch 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: " Eric Dong
2018-11-08 13:33 ` Laszlo Ersek
2018-11-08 17:51 ` Laszlo Ersek
2018-11-09 5:33 ` Dong, Eric
2018-11-09 8:41 ` Ni, Ruiyu
2018-11-10 3:19 ` [Patch 0/2] " Dong, Eric
2018-11-12 10:30 ` Laszlo Ersek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=894fecc5-1cc0-d1d0-0252-2347f4db10a4@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox