From: "Laszlo Ersek" <lersek@redhat.com>
To: "Dong, Eric" <eric.dong@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Ni, Ray" <ray.ni@intel.com>
Subject: Re: [edk2-devel] [Patch 1/4] UefiCpuPkg/RegisterCpuFeaturesLib: Add "detect before set" Micros.
Date: Mon, 12 Aug 2019 15:01:55 +0200 [thread overview]
Message-ID: <d4e4148b-d674-4838-d53f-a9beb98d26b1@redhat.com> (raw)
In-Reply-To: <ED077930C258884BBCB450DB737E662259EC0CAC@shsmsx102.ccr.corp.intel.com>
On 08/12/19 09:46, Dong, Eric wrote:
> Hi Laszlo,
>
>> -----Original Message-----
>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>> Laszlo Ersek
>> Sent: Friday, August 9, 2019 11:14 PM
>> To: Dong, Eric <eric.dong@intel.com>; devel@edk2.groups.io
>> Cc: Ni, Ray <ray.ni@intel.com>
>> Subject: Re: [edk2-devel] [Patch 1/4] UefiCpuPkg/RegisterCpuFeaturesLib:
>> Add "detect before set" Micros.
>>
>> On 08/09/19 08:11, Eric Dong wrote:
>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040
>>>
>>> Add below new micros which test the current value before set the new
>>> value. Only set new value when current value not same as new value.
>>> CPU_REGISTER_TABLE_TEST_THEN_WRITE32
>>> CPU_REGISTER_TABLE_TEST_THEN_WRITE64
>>> CPU_REGISTER_TABLE_TEST_THEN_WRITE_FIELD
>>>
>>> Signed-off-by: Eric Dong <eric.dong@intel.com>
>>> Cc: Ray Ni <ray.ni@intel.com>
>>> Cc: Laszlo Ersek <lersek@redhat.com>
>>> ---
>>> UefiCpuPkg/Include/AcpiCpuData.h | 1 +
>>> .../Include/Library/RegisterCpuFeaturesLib.h | 77 +++++++++++++++++--
>>> .../RegisterCpuFeaturesLib.c | 14 +++-
>>> 3 files changed, 80 insertions(+), 12 deletions(-)
>>
>> (1) When you format your patch sets, can you please use the following two
>> options:
>>
>> --stat=1000 --stat-graph-width=20
>>
>> Otherwise the diffstats are truncated (on the left) and hard to understand.
>>
>
> 1. I use TortoiseGit to create patch, do you know how to enable these setting in TortoiseGit?
Sorry, no clue :(
>
>>>
>>> diff --git a/UefiCpuPkg/Include/AcpiCpuData.h
>>> b/UefiCpuPkg/Include/AcpiCpuData.h
>>> index b963a2f592..c764e209cf 100644
>>> --- a/UefiCpuPkg/Include/AcpiCpuData.h
>>> +++ b/UefiCpuPkg/Include/AcpiCpuData.h
>>> @@ -81,6 +81,7 @@ typedef struct {
>>> UINT16 Reserved; // offset 10 - 11
>>> UINT32 HighIndex; // offset 12-15, only valid for
>> MemoryMapped
>>> UINT64 Value; // offset 16-23
>>> + UINT8 DetectIt; // 0ffset 24
>>> } CPU_REGISTER_TABLE_ENTRY;
>>
>> (2) Another quite generic comment -- "DetectIt" does not look helpful.
>> Somehow the verb "detect" does not communicate the right action to me.
>>
>> How about using a more established name, such as:
>>
>> - CompareAndSwap
>> - CompareAndSet
>> - TestAndSet
>>
>> ?
>>
>> If you agree, then I suggest updating the parameter names, and their
>> comments too, below.
>
> 2. Yes, I change from "TestIt" to "DetectIt" because I think it's better. Seems like this is not a correct change.
> I will use "TestThenWrite" as the new name which align our new macro " CPU_REGISTER_TABLE_TEST_THEN_WRITE****". What do you think?
Sounds good, thanks.
Laszlo
next prev parent reply other threads:[~2019-08-12 13:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 6:11 [Patch 0/4] Add "Test then Set" mechanism Dong, Eric
2019-08-09 6:11 ` [Patch 1/4] UefiCpuPkg/RegisterCpuFeaturesLib: Add "detect before set" Micros Dong, Eric
2019-08-09 15:14 ` Laszlo Ersek
2019-08-12 7:46 ` [edk2-devel] " Dong, Eric
2019-08-12 13:01 ` Laszlo Ersek [this message]
2019-08-09 15:31 ` Laszlo Ersek
2019-08-12 8:05 ` Dong, Eric
2019-08-09 6:11 ` [Patch 2/4] UefiCpuPkg/RegisterCpuFeaturesLib: Supports detect before set new value logic Dong, Eric
2019-08-09 6:11 ` [Patch 3/4] UefiCpuPkg/PiSmmCpuDxeSmm: " Dong, Eric
2019-08-09 15:30 ` Laszlo Ersek
2019-08-12 8:37 ` [edk2-devel] " Dong, Eric
2019-08-09 6:11 ` [Patch 4/4] UefiCpuPkg/CpuCommonFeaturesLib: Use "Test then set" action Dong, Eric
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=d4e4148b-d674-4838-d53f-a9beb98d26b1@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