From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (NAM04-SN1-obe.outbound.protection.outlook.com [40.107.70.102]) by mx.groups.io with SMTP id smtpd.web10.6192.1601002637060153599 for ; Thu, 24 Sep 2020 19:57:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=Vb93QMvQ; spf=pass (domain: microsoft.com, ip: 40.107.70.102, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P5E+f2P4dy1XGaQcjz7QeDIjbZU1eN6pASF3eMGwAe7pzRjAFskAmBLY1/FZOyH0sVHBtYGtZsd/SNGVYJzbdeFZs9PahPVFCO23gzx75+kjZEBSU0Fnf47i6xdH/+tRJiOwRmOaq6S6wrlFBlc3sM+SpXR08hzdkbsl6IYXn4xOsj4uc32vxK6VO1Zx92t2WLvUGauf2yk11rxQORpRMAgnHfCAx9aBfddDbv0FwnlVsunPjzuBQNXpZlJRC9W6XHocpgzygGkL404N0tHsJug3ODU6jvDZjDvYgSJ5n8R//+tydF6cConXarj3m7MCHsshcFNdGuhYmi1oIhgGtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2KXv9kQV/0NsEBB1ohwroY0JEyUayd2qOAxcwx3LjBM=; b=R4++p3/TIA7fBJdvpvrsEc6iE5zXhecTkze+So4uzCGfB30XUmY/9GeYuj6yVnJaEBTDeERpfBRD1PLTdftab1StAUeSllab2r7eq0M3yUGeRVU3t2WvHnnYVtMaK65qnjrRj3v4I05hhq2UfpPJgqXhsjgAK886qzuoCawa8PXHxA4rjTlbmh9QxlWKcaQStqiu5fkbOt3Vm781ntT0l0bg3iZWyHYqqG4bW91n/DICQU49H15UkYWaKuuOTBq6PaIZAl7IfnuV3DSp8sRNHAD94BVmE5/s9vPVdv+2c4Tta0RGu7uAwtiZxz1SmWl4qp6kPRTENqbH64w+bNkU/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2KXv9kQV/0NsEBB1ohwroY0JEyUayd2qOAxcwx3LjBM=; b=Vb93QMvQbQq2mFJy3pBJSPdn3W6GiGZ9e53WbjSDKFG3nyLcwt674cs4ZVPPjv5gbZVT0hGGrHXWSuvVKJZcDNvBiTQeAuWtOG48UXlxp51e1gXuYlPN3S3mCKu1Qs+vDKpSmp1Q9DQTgKZxtpTdtW5FQcSu64xW+yVN+lcwuZo= Received: from MW4PR21MB1857.namprd21.prod.outlook.com (2603:10b6:303:74::12) by MWHPR21MB0189.namprd21.prod.outlook.com (2603:10b6:300:79::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.4; Fri, 25 Sep 2020 02:57:14 +0000 Received: from MW4PR21MB1857.namprd21.prod.outlook.com ([fe80::2967:7434:51bb:e234]) by MW4PR21MB1857.namprd21.prod.outlook.com ([fe80::2967:7434:51bb:e234%4]) with mapi id 15.20.3433.018; Fri, 25 Sep 2020 02:57:14 +0000 From: "Bret Barkelew" To: Andrew Fish , edk2-devel-groups-io CC: Ken Taylor Subject: Re: [EXTERNAL] Re: [edk2-devel] ECC: Won't somebody PLEASE think of the... test structures. Thread-Topic: [EXTERNAL] Re: [edk2-devel] ECC: Won't somebody PLEASE think of the... test structures. Thread-Index: AQHWktooEicGg8j40UW1Z0xLUDeoV6l4lrAQgAAJNUqAAAcVAIAAATfK Date: Fri, 25 Sep 2020 02:57:14 +0000 Message-ID: References: <29096719f8d541c3aa25f9738a61b1d3@SCL-EXCHMB-13.phoenix.com> , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-09-25T02:52:46.4948905Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: apple.com; dkim=none (message not signed) header.d=none;apple.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [174.21.140.128] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8a8e1688-e80b-478c-c37c-08d860feb510 x-ms-traffictypediagnostic: MWHPR21MB0189: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0T76KVthkVRJUWIWrsNT4LFpMOq4REy/nVAdGb+IrhHw3RAZSjCtolG60KiV9FXxtpWGZevuvKVAS49H2Qnspc9IS6lwUNLyhmusHMeL+OZsf0Tl83MH4WFZup6pFA28+tf05wyDyhj/bvOJajURc8Tc9x+2uRsCceWdDzExJUCHpBRvbvaIZd3BXKxmCWHQHUYI2/8zpGQo4y9yoiOz2nBO+YMuQQyXiiSe7I5GtwhVjfT1bUnIAhRJHCIQkXwQryL7EJYWIMfpQVv5LiVBk4rNhDxWmv7Tq/t+ZdTJU6E772DwhlAKKG5ZDvJCXx4Jf8Jza9z9Zo8APKFWqhS51etTTFftK833asE4NxqK+dLI7XYcDHc1wNC3ibIcKCu81a9+kFqPV5S7pNV4c1T2YWlgm0RSOkVrb++sIeICfHoVhN2KoI1nVtmCLdzalG0qf9IoKE9Y+dwSBaHdOUqh9Q== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR21MB1857.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(346002)(366004)(39860400002)(136003)(396003)(83380400001)(316002)(478600001)(76236003)(82950400001)(166002)(10290500003)(71200400001)(110136005)(2906002)(99936003)(4326008)(8676002)(66616009)(53546011)(9686003)(33656002)(82960400001)(55016002)(7696005)(5660300002)(66476007)(52536014)(86362001)(186003)(64756008)(66446008)(66946007)(8936002)(6506007)(66556008)(76116006)(8990500004)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: x1OdmJpJ96z3t3mj+PB+li6Yt6QLaenXCflsJE7SPhK2wKb2wmyjZue5YTS0hVMvp8/vTAliZlSZ0M7sHxeQmTqF7ZQB0JVpreArvUL05X9nX+rQgkw5fQllTMMa8UVTRQ88CvnPVfOy7Pz45BuIyutyEzmqATD2d21R9gUUy3MLfUhxoKQo4IZ5elzaKCCLRLucf/ZOxfMVvRKCA3+fb2NAGrxRGLHWvVSVqpzeTPlaETnIs/zCDfMfkaO9fxJfBzeEs5tn9L5MrTwLWUNm73CcfL8MpaznouLK1A+NOZb+QETJle1lZ909sKd2IMo5PEY45y/6y8jJP4snlNCn1XkwEBhOLv1MqLnS67UL2Jpy0O6VazP9zJsuc0NCG5jnrk31amr0mzrocbdSh9owkT5+YRCKZ4JFC+JAGSmr+O6gva0SkacnSjAa00Y9pV+2lccoQuhkcu5HoVatx35BT/irg1kZilbkT8tf7FEzAAQW60y9mMEM1XIetlh5h9MbQTNr7e6x3Y33chonW9KOLBeZh23i09FmOrHsf4BOHNJg47+FwKOC75SnG8WMxt89uLm0Qx8NKXUQJbg3wbZu2dqACGjF6d8vOxozMmdmlNx7zKZJy6NSlSnkWjGMmnRtmdrLnR8W6wpvZmVSRiczfQ== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR21MB1857.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a8e1688-e80b-478c-c37c-08d860feb510 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2020 02:57:14.7026 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nIcLon2cIbz0QJVI1SRJ0g/bD6aSvZw/AtLpxU+nS9RfKrVbNeNS5JrF7VA3wKrOVpX7v8ob0am3WMkGiDv3DA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0189 X-Groupsio-MsgNum: 65604 Content-Language: en-US Content-Type: multipart/related; boundary="_004_MW4PR21MB1857EABB8471AF0D6CDE3247EF360MW4PR21MB1857namp_"; type="multipart/alternative" --_004_MW4PR21MB1857EABB8471AF0D6CDE3247EF360MW4PR21MB1857namp_ Content-Type: multipart/alternative; boundary="_000_MW4PR21MB1857EABB8471AF0D6CDE3247EF360MW4PR21MB1857namp_" --_000_MW4PR21MB1857EABB8471AF0D6CDE3247EF360MW4PR21MB1857namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Andrew, That=92s actually what got me here. EccCheck runs as part of our CI now (b= ut it didn=92t when I wrote these tests a year ago). I need to either figur= e out how to get this code to pass EccCheck in a reasonable way, or just no= t contribute the tests and say =93go to Mu for the tests, if you want them= =94. Skipping the contribution isn=92t a desirable outcome at all for a number = of reasons, not the least of which is that we (MS and others) are trying en= courage all contributions to come with tests, so the process of writing the= m needs to be simple and painless. - Bret From: Andrew Fish Sent: Thursday, September 24, 2020 7:48 PM To: edk2-devel-groups-io; Bret Barkelew Cc: Ken Taylor Subject: [EXTERNAL] Re: [edk2-devel] ECC: Won't somebody PLEASE think of t= he... test structures. Bret, I=92ve had this issue with EFI code too. It will compile with for DEBUG an= d RELEASE as the optimizer removes the memcpy/memset. So you only see a bui= ld failure when you compiler NOOPT (and there are no intrinsic libs). I mos= tly see this in platform code when I try to compile a single driver/lib NOO= PT and it fails to link due to the missing intrinsic. The easy to enforce this is to compile with optimizations enabled and don= =92t enable intrinsic libs. Not sure if that is really practical from the = test point of view. Seems the tool caught the coding style violation so I guess we could try t= o =93make running that tool easier=94. Maybe hooking into patchcheck.py, ma= king some kind of githook, or adding a git command? Thanks, Andrew Fish On Sep 24, 2020, at 7:25 PM, Bret Barkelew via groups.io > wro= te: So for context, this is a new host-based test that should only run within = a platform OS, so intrinsics aren=92t the big deal that they would be in FW= code. But we do need to figure out how to simultaneously adhere to the coding co= nvention while enabling test authoring. Or we chose to not enforce quite as many things for tests. I=92d prefer the first. - Bret From: Ken Taylor Sent: Thursday, September 24, 2020 6:57 PM To: devel@edk2.groups.io; Bret Barkelew Subject: [EXTERNAL] RE: ECC: Won't somebody PLEASE think of the... test st= ructures. If the structure is a non-static local variable, most compilers will silen= tly inject an intrinsic call to memcpy in function initialization. This le= ads to an intermittent linker error. If the compiler you use automatically supports an intrinsic memcpy in the = given architecture or optimizes out the memcpy, it will build for you and y= ou won=92t know you need to link to an intrinsic support library in order t= o build cross platform. This leads to code that builds for you, but not fo= r me. Regards, -Ken. From: devel@edk2.groups.io [mailto:devel@edk2= .groups.io] On Behalf Of Bret Barkelew via groups.io Sent: Thursday, September 24, 2020 6:23 PM To: devel@edk2.groups.io Subject: [edk2-devel] ECC: Won't somebody PLEASE think of the... test stru= ctures. ERROR - EFI coding style error ERROR - *Error code: 5007 ERROR - *There should be no initialization of a variable as part of its de= claration ERROR - *file: //home/corthon/_uefi/edk2_qemu_ci/edk2/MdeModulePkg/Library= /VariablePolicyLib/VariablePolicyUnitTest/VariablePolicyUnitTest.c ERROR - *Line number: 333 ERROR - *Variable Name: MatchCheckPolicy EccCheck no likey: SIMPLE_VARIABLE_POLICY_ENTRY ValidationPolicy =3D { { VARIABLE_POLICY_ENTRY_REVISION, sizeof(VARIABLE_POLICY_ENTRY) + sizeof(TEST_VAR_1_NAME), sizeof(VARIABLE_POLICY_ENTRY), TEST_GUID_1, TEST_POLICY_MIN_SIZE_NULL, TEST_POLICY_MAX_SIZE_NULL, TEST_POLICY_ATTRIBUTES_NULL, TEST_POLICY_ATTRIBUTES_NULL, VARIABLE_POLICY_TYPE_NO_LOCK }, TEST_VAR_1_NAME }; But you can=92t init this structure separately without addressing each fie= ld. Can a brother get an override? - Bret <95B370A7BEED49AAB797022E8F260C8F.png> --_000_MW4PR21MB1857EABB8471AF0D6CDE3247EF360MW4PR21MB1857namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Andrew,

 

That=92s actually what got me here. EccCheck runs a= s part of our CI now (but it didn=92t when I wrote these tests a year ago).= I need to either figure out how to get this code to pass EccCheck in a rea= sonable way, or just not contribute the tests and say =93go to Mu for the tests, if you want them=94.

 

Skipping the contribution isn=92t a desirable outco= me at all for a number of reasons, not the least of which is that we (MS an= d others) are trying encourage all contributions to come with tests, so the= process of writing them needs to be simple and painless.

 

- Bret

 

From: Andrew Fish
Sent: Thursday, September 24, 2020 7:48 PM
To: edk2-devel-groups-io; Bret Barkelew
Cc: Ken Taylor
Subject: [EXTERNAL] Re: [edk2-devel] ECC: Won't somebody PLEASE thi= nk of the... test structures.

 

Bret,

 

I=92ve had this issue with EFI code too. It will co= mpile with for DEBUG and RELEASE as the optimizer removes the memcpy/memset= . So you only see a build failure when you compiler NOOPT (and there are no= intrinsic libs). I mostly see this in platform code when I try to compile a single driver/lib NOOPT and it fail= s to link due to the missing intrinsic. 

 

The easy to enforce this is to compile with optimiz= ations enabled and don=92t enable intrinsic libs. Not sure if that is reall= y practical from the test point of view. 

 

Seems the tool caught the coding style violation so= I guess we could try to =93make running that tool easier=94. Maybe hooking= into patchcheck.py, making some kind of githook, or adding a git command? =  

 

Thanks,

 

Andrew Fish

 



On Sep 24, 2020, at 7:25 PM, Bret Barkelew via groups.io <bret.barkelew=3Dmicrosoft.com@groups.io> wrote:

 

So for context, this is a new host-based test that = should only run within a platform OS, so intrinsics aren=92t the big deal t= hat they would be in FW code.

 

But we do need to figure out how to simultaneously = adhere to the coding convention while enabling test authoring.

Or we chose to not enforce quite as many things for= tests.

 

I=92d prefer the first. 

 

- Bret <= /span>

 

From: = ;Ken Taylor
Sent: Thursday, S= eptember 24, 2020 6:57 PM
To: devel@edk2.groups.io; = Bret Barkelew
Subject: [EXTERNA= L] RE: ECC: Won't somebody PLEASE think of the... test structures.

 

If the structure is a= non-static local variable, most compilers will silently inject an intrinsi= c call to memcpy in function initialization.  This leads to an intermi= ttent linker error.

 

If the compiler you u= se automatically supports an intrinsic memcpy in the given architecture or = optimizes out the memcpy, it will build for you and you won=92t know you ne= ed to link to an intrinsic support library in order to build cross platform.  This leads to code that builds fo= r you, but not for me.

 

Regards,<= /o:p>

-Ken.

 

From: devel@edk= 2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bret Bark= elew via groups.io
Sent: Thursday, S= eptember 24, 2020 6:23 PM
To: devel@edk2.groups.io
Subject: [edk2-de= vel] ECC: Won't somebody PLEASE think of the... test structures.

 

ERROR - EFI coding style error

ERROR - *Error code: 5007

ERROR - *There should be no initialization of a var= iable as part of its declaration

ERROR - *file: //home/corthon/_uefi/edk2_qemu_ci/ed= k2/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/VariablePo= licyUnitTest.c

ERROR - *Line number: 333

ERROR - *Variable Name: MatchCheckPolicy=

 

EccCheck no likey:

SIMPLE_VARIABLE_POLICY_ENTRY   Validation= Policy =3D {

    {

      VARIABLE_POLICY_ENTR= Y_REVISION,

      sizeof(VARIABLE_POLI= CY_ENTRY) + sizeof(TEST_VAR_1_NAME),

      sizeof(VARIABLE_POLI= CY_ENTRY),

      TEST_GUID_1,

      TEST_POLICY_MIN_SIZE= _NULL,

      TEST_POLICY_MAX_SIZE= _NULL,

      TEST_POLICY_ATTRIBUT= ES_NULL,

      TEST_POLICY_ATTRIBUT= ES_NULL,

      VARIABLE_POLICY_TYPE= _NO_LOCK

    },

    TEST_VAR_1_NAME

  };

 

But you can=92t init this structure separately with= out addressing each field.

Can a brother get an override?

 

- Bret <= /span>

 

 

<95B370A7BEED49AAB797022E8F260C8F.png>=

 

 

--_000_MW4PR21MB1857EABB8471AF0D6CDE3247EF360MW4PR21MB1857namp_-- --_004_MW4PR21MB1857EABB8471AF0D6CDE3247EF360MW4PR21MB1857namp_ Content-Type: image/png; name="956D9B34BE2C49FA8D0841584A830F55.png" Content-Description: 956D9B34BE2C49FA8D0841584A830F55.png Content-Disposition: inline; filename="956D9B34BE2C49FA8D0841584A830F55.png"; size=139; creation-date="Fri, 25 Sep 2020 02:57:14 GMT"; modification-date="Fri, 25 Sep 2020 02:57:14 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAkwAAAABCAYAAAAsPfFYAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAgSURBVEhLY9h/9vb/UTyKR/EoHsWjeBSP4lGM C9/+DwC4oc6y97aQZAAAAABJRU5ErkJggg== --_004_MW4PR21MB1857EABB8471AF0D6CDE3247EF360MW4PR21MB1857namp_--