From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.14462.1604681194788073878 for ; Fri, 06 Nov 2020 08:46:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HTPP0fZg; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604681193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KoUvqMe6c+vXpUK9qVsMy5/Vxk/KLM5+y35/o8AIA38=; b=HTPP0fZguSg4KZwSLAMdoTByl9BYa1dw7f54QhkiuWBf9vSnzmBU6S98R8GNytFGObXK5H FjEODTTKBSL2Y4659HE/W93uqP74SDj1eIMi2so9XGmscxSzQp4JqBK7+hmUTTuRk0PCxv F6APPGi/h5XHwkfwwRSnODt7KWpv6is= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-dshf2z7IN8m1kbKBkF8Xrg-1; Fri, 06 Nov 2020 11:46:30 -0500 X-MC-Unique: dshf2z7IN8m1kbKBkF8Xrg-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id EB1A7107ACF9; Fri, 6 Nov 2020 16:46:27 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-95.ams2.redhat.com [10.36.115.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id F199F68431; Fri, 6 Nov 2020 16:46:24 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v3 00/11] SEV-ES guest support fixes and cleanup To: Tom Lendacky , devel@edk2.groups.io Cc: Brijesh Singh , Ard Biesheuvel , Eric Dong , Liming Gao , Jordan Justen , Michael D Kinney , Rahul Kumar , Zhiguang Liu , Ray Ni References: <41dd8877-4954-e32d-0398-b4f0525bc2de@redhat.com> <1ab7c714-4921-b85b-23ab-7060f6c1ff59@amd.com> From: "Laszlo Ersek" Message-ID: Date: Fri, 6 Nov 2020 17:46:23 +0100 MIME-Version: 1.0 In-Reply-To: <1ab7c714-4921-b85b-23ab-7060f6c1ff59@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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) \ > + (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), then I suggest posting v4 -- Liming should please re-check the udpated MdePkg patch, and then we can merge the series. Thanks! Laszlo