From: "Lendacky, Thomas" <thomas.lendacky@amd.com>
To: Laszlo Ersek <lersek@redhat.com>, devel@edk2.groups.io
Cc: Brijesh Singh <brijesh.singh@amd.com>,
Ard Biesheuvel <ard.biesheuvel@arm.com>,
Eric Dong <eric.dong@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Jordan Justen <jordan.l.justen@intel.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Rahul Kumar <rahul1.kumar@intel.com>,
Zhiguang Liu <zhiguang.liu@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: Re: [edk2-devel] [PATCH v3 00/11] SEV-ES guest support fixes and cleanup
Date: Fri, 6 Nov 2020 11:48:32 -0600 [thread overview]
Message-ID: <e9ee0150-c872-52e6-0a2d-b1768e2d0974@amd.com> (raw)
In-Reply-To: <aa887aae-4732-6ef2-7730-606aad3e6bd4@redhat.com>
On 11/6/20 10:46 AM, Laszlo Ersek wrote:
> On 11/06/20 07:29, Tom Lendacky wrote:
>> On 11/5/20 8:34 AM, Tom Lendacky wrote:
>>> On 11/4/20 9:29 PM, Laszlo Ersek wrote:
>
>>>> I've submitted PR#1086 [...] but CI seems slower than usual today,
>>>> and I really need some sleep, so I won't wait for CI. Tom, if the PR
>>>> succeeds, please close TianoCore#3008, noting the commit range, and
>>>> please also follow up in this thread with the commit range.
>>>
>>> Thanks, Laszlo!
>>>
>>> It looks like it failed because it doesn't like the use of the
>>> "sizeof (UINT64)". I suppose I can change that to just hard code a
>>> value of 8. Let me know what you think.
>>
>> I did verify that changing the "sizeof (UINT64)" to "8" in the first
>> patch results in all CI tests passing. I can re-submit with that, if
>> you feel that is the best course of action.
>
>
> So this is the error (from ECC), if I understand correctly:
>
>> 2020-11-05T03:25:05.2175761Z ERROR - EFI coding style error
>> 2020-11-05T03:25:05.2176262Z ERROR - *Error code: 8005
>> 2020-11-05T03:25:05.2177026Z ERROR - *Variable name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters 4. Global variable name must start with a 'g'
>> 2020-11-05T03:25:05.2177773Z ERROR - *file: //home/vsts/work/1/s/MdePkg/Include/Register/Amd/Ghcb.h
>> 2020-11-05T03:25:05.2180810Z ERROR - *Line number: 114
>> 2020-11-05T03:25:05.2181426Z ERROR - *Member variable [GHCB_REGISTER.(UINT64)] NOT follow naming convention.
>
> for such lines as:
>
>> GhcbCpl = OFFSET_OF (GHCB, SaveArea.Cpl) / sizeof (UINT64),
>
> I think this is a bug in CheckMemberVariableFormat(), in
> "BaseTools/Source/Python/Ecc/c.py".
>
> I don't exactly understand how that ECC method functions. However,
> squashing the following update into the first (MdePkg) patch of this
> series seems to work:
>
>> diff --git a/MdePkg/Include/Register/Amd/Ghcb.h b/MdePkg/Include/Register/Amd/Ghcb.h
>> index 1fce64d5b7cd..3814a79e0619 100644
>> --- a/MdePkg/Include/Register/Amd/Ghcb.h
>> +++ b/MdePkg/Include/Register/Amd/Ghcb.h
>> @@ -111,17 +111,20 @@ typedef PACKED struct {
>> UINT32 GhcbUsage;
>> } GHCB;
>>
>> +#define GHCB_SAVE_AREA_WORD_OFFSET(RegisterField) \
I'll make one minor change here, s/WORD/QWORD/.
>> + (OFFSET_OF (GHCB, SaveArea.RegisterField) / sizeof (UINT64))
>> +
>> typedef enum {
>> - GhcbCpl = OFFSET_OF (GHCB, SaveArea.Cpl) / sizeof (UINT64),
>> - GhcbRax = OFFSET_OF (GHCB, SaveArea.Rax) / sizeof (UINT64),
>> - GhcbRbx = OFFSET_OF (GHCB, SaveArea.Rbx) / sizeof (UINT64),
>> - GhcbRcx = OFFSET_OF (GHCB, SaveArea.Rcx) / sizeof (UINT64),
>> - GhcbRdx = OFFSET_OF (GHCB, SaveArea.Rdx) / sizeof (UINT64),
>> - GhcbXCr0 = OFFSET_OF (GHCB, SaveArea.XCr0) / sizeof (UINT64),
>> - GhcbSwExitCode = OFFSET_OF (GHCB, SaveArea.SwExitCode) / sizeof (UINT64),
>> - GhcbSwExitInfo1 = OFFSET_OF (GHCB, SaveArea.SwExitInfo1) / sizeof (UINT64),
>> - GhcbSwExitInfo2 = OFFSET_OF (GHCB, SaveArea.SwExitInfo2) / sizeof (UINT64),
>> - GhcbSwScratch = OFFSET_OF (GHCB, SaveArea.SwScratch) / sizeof (UINT64),
>> + GhcbCpl = GHCB_SAVE_AREA_WORD_OFFSET (Cpl),
>> + GhcbRax = GHCB_SAVE_AREA_WORD_OFFSET (Rax),
>> + GhcbRbx = GHCB_SAVE_AREA_WORD_OFFSET (Rbx),
>> + GhcbRcx = GHCB_SAVE_AREA_WORD_OFFSET (Rcx),
>> + GhcbRdx = GHCB_SAVE_AREA_WORD_OFFSET (Rdx),
>> + GhcbXCr0 = GHCB_SAVE_AREA_WORD_OFFSET (XCr0),
>> + GhcbSwExitCode = GHCB_SAVE_AREA_WORD_OFFSET (SwExitCode),
>> + GhcbSwExitInfo1 = GHCB_SAVE_AREA_WORD_OFFSET (SwExitInfo1),
>> + GhcbSwExitInfo2 = GHCB_SAVE_AREA_WORD_OFFSET (SwExitInfo2),
>> + GhcbSwScratch = GHCB_SAVE_AREA_WORD_OFFSET (SwScratch),
>> } GHCB_REGISTER;
>>
>> typedef union {
>
> I build-tested this update with gcc, and also verified that it passes
> ECC, by running CI locally. (I reproduced the bogus ECC error message
> locally at first, of course, to see if the update makes a difference.)
>
>> PROGRESS - --Running MdePkg: EccCheck Test NO-TARGET --
>> PROGRESS - --->Test Success: EccCheck Test NO-TARGET
>
> If it works for you as well (check with a personal build PR perhaps),
Yup, that works, all tests passed.
> then I suggest posting v4 -- Liming should please re-check the udpated
> MdePkg patch, and then we can merge the series.
Ok, I'll submit a v4 and without Liming's Reviewed-by on the first patch.
Thanks,
Tom
>
> Thanks!
> Laszlo
>
prev parent reply other threads:[~2020-11-06 17:48 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 14:17 [PATCH v3 00/11] SEV-ES guest support fixes and cleanup Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 01/11] MdePkg: Clean up GHCB field offsets and save area Lendacky, Thomas
2020-10-30 1:03 ` 回复: " gaoliming
2020-10-29 14:17 ` [PATCH v3 02/11] UefiCpuPkg/VmgExitLib: Add interfaces to set/read GHCB ValidBitmap bits Lendacky, Thomas
2020-11-03 16:22 ` [edk2-devel] " Laszlo Ersek
2020-11-03 16:38 ` Laszlo Ersek
2020-11-04 8:19 ` Dong, Eric
2020-10-29 14:17 ` [PATCH v3 03/11] OvmfPkg/VmgExitLib: Implement new VmgExitLib interfaces Lendacky, Thomas
2020-11-03 16:26 ` [edk2-devel] " Laszlo Ersek
2020-10-29 14:17 ` [PATCH v3 04/11] OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 05/11] OvmfPkg/VmgExitLib: Set the SwScratch valid bit for IOIO events Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 06/11] OvmfPkg/VmgExitLib: Set the SwScratch valid bit for MMIO events Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 07/11] UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 08/11] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Set the SwScratch valid bit Lendacky, Thomas
2020-10-29 14:18 ` [PATCH v3 09/11] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Fix erase blocks for SEV-ES Lendacky, Thomas
2020-10-29 14:18 ` [PATCH v3 10/11] UefiCpuPkg, OvmfPkg: Disable interrupts when using the GHCB Lendacky, Thomas
2020-11-03 16:38 ` [edk2-devel] " Laszlo Ersek
2020-11-04 8:20 ` Dong, Eric
2020-10-29 14:18 ` [PATCH v3 11/11] UefiCpuPkg/MpInitLib: For SEV-ES guest, set stack based on processor number Lendacky, Thomas
2020-11-02 16:46 ` [PATCH v3 00/11] SEV-ES guest support fixes and cleanup Laszlo Ersek
2020-11-05 3:29 ` [edk2-devel] " Laszlo Ersek
2020-11-05 14:34 ` Lendacky, Thomas
2020-11-06 6:29 ` Lendacky, Thomas
2020-11-06 16:46 ` Laszlo Ersek
2020-11-06 17:48 ` Lendacky, Thomas [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=e9ee0150-c872-52e6-0a2d-b1768e2d0974@amd.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