From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (NAM04-CO1-obe.outbound.protection.outlook.com [40.107.69.102]) by mx.groups.io with SMTP id smtpd.web11.6035.1601178028979952094 for ; Sat, 26 Sep 2020 20:40:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=JqJInzFt; spf=pass (domain: microsoft.com, ip: 40.107.69.102, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ledEOO0xNl/zmS7E7N1qiNrZfXKLRd2GYKw8ytkBQK8nLBKpLzeCxv+xGKRKmJSXKRN5xYaPUL5e93vaVO4kkdMDp4I2Pmrnpv2A4SlZ3lSorgBQZnnGHtC8IFMGTW+TWjxjfUgORmSBSPwQRTLs+s3j34batpeSkMXT3ajBMP5sRPJJF/6OODf94wkv3xUIakwE79mkAZVssy3BfF9cpTiUrcn4sMzX4BGXuPZR8+4e4rS4lO+ljHOCStjnYl55xA3Eaw+dv5BYeA3/ggEHBv6TOSmQp/StWv/lvC/DDU0mvsZ/2jhTqX/ZV6JJDyZO+ixQuXESTMEeytamsaT0LA== 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=9+pXlXCNKXoF62L2SLnTSTFInElOeAn8gngmkWXc+7M=; b=XBaSCickQ10umprT1WRF3InyTBUipYAjY3FiQi/mXNTvxF6MML2BqsIH85LvWndKlevXBTs0Zsnqq6U0lQMbObnmGSlCdZfSbm+jCd3QNcVamSfWzKKECUHvm2/UZL68d0L+JH9MrqnPAoQ4ZQ7g1EmyC8J+Jy68J/yZlBwXJe5yR6MAwIaUz6pHaWhiC1ZmzGFC29SoKUW1lW572MCqxR2Mm6GedKmH5XNE05Mv6gOvDAQA0rRFQZCHm14oeCx4FnkH6hntvcbYGYFW8klOfrM1h4dnYkcFmZiA1eFmcZjT+YBxITiEjPQ0jYx/TE0haVhhLsJzHduABfS60NBPpw== 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=9+pXlXCNKXoF62L2SLnTSTFInElOeAn8gngmkWXc+7M=; b=JqJInzFtKBtdR5iU0whwsCr13KEccTDjhsIghfnFCGC6R3o2+dx0YaA/PXPlJobC4xYyJFo3t6SXQOfHSa+dGjN/aISPPB0g/WrI4TpIF9hvjaibAgcABQvDINqv6MvaOimKWaOMgXkBMezC1GOrlPmOWDrRvawHRTTv3w09mxI= Received: from MW4PR21MB1857.namprd21.prod.outlook.com (2603:10b6:303:74::12) by MW4PR21MB1859.namprd21.prod.outlook.com (2603:10b6:303:7f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.7; Sun, 27 Sep 2020 03:40:27 +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.025; Sun, 27 Sep 2020 03:40:27 +0000 From: "Bret Barkelew" To: Andrew Fish CC: edk2-devel-groups-io , Ken Taylor Subject: Re: [EXTERNAL] [edk2-devel] ECC: Won't somebody PLEASE think of the... test structures. Thread-Topic: [EXTERNAL] [edk2-devel] ECC: Won't somebody PLEASE think of the... test structures. Thread-Index: AQHWk7Ahn5kEm/k5Y0Sxk7DSYuc4eal72BHR Date: Sun, 27 Sep 2020 03:40:27 +0000 Message-ID: References: <29096719f8d541c3aa25f9738a61b1d3@SCL-EXCHMB-13.phoenix.com> ,<4929ABCC-75D2-42B3-938D-EE9C78B1FFDD@apple.com> In-Reply-To: <4929ABCC-75D2-42B3-938D-EE9C78B1FFDD@apple.com> Accept-Language: en-US X-MS-Has-Attach: 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-27T03:38:53.5669737Z;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: 042a046c-ffdf-4da5-8be6-08d862971307 x-ms-traffictypediagnostic: MW4PR21MB1859: 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: Tr3+EGY3ieqycH/AFjp5s9eSE84kw769z/xCkIhusJDqmnvCopSk9TREMDMKEgeF5IiDshn5frFtByNFjB28ePHQNwYC8cQ0adEsHUscqzUcdtdYu+NhzciZrSHfh0DrZz6sP61qV/kgBA99GlSdgjucl3K7yYAXnFKlg+/jOf7AhX4KP2k2qXULqY/aI4X2BKfDktzuzguYaznRNB8waSG/x6N/PSRTrAIR+RSzNXb7Sggkq+I+HotBUWGm8BDrY6o1JbITc0Fm9+HqN4e2tF/mprU5POtLZAzQ/ghMDgTVNM1KoIrD9J32m9u2vStkh5v3nCoXziZPuq0tT0fJqrY0lAhsXlB7lSs92c/xgYLiJWSmP1bIl5D8+13pe6Yb9DindsYaBxswUEFSA3VrjQ== 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)(39860400002)(136003)(396003)(346002)(376002)(366004)(8676002)(83080400001)(83380400001)(8936002)(86362001)(55016002)(52536014)(9686003)(71200400001)(8990500004)(82950400001)(33656002)(2906002)(82960400001)(166002)(5660300002)(76116006)(186003)(26005)(478600001)(76236003)(54906003)(6506007)(53546011)(316002)(4326008)(6916009)(10290500003)(66446008)(64756008)(66556008)(66476007)(66946007)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: oMYxpUjd2UbExKjbkjQcaHKJEtWNCd3MLxS5liqAoF+tABc3F6BpSkm5okQT8wSaLaBc/vkAe04EWPYEYpMSsV6HU7uWkGI6ITQakvi50/9qEWlgwA/9HmtSsASuc6aoolrlGa49+DIVN4Sv5lftblTz6l+Vulw83YC3gZNzvkHXlOy5sDjmx43m+G4gS5FrKmV+y87t6aHFuNSK4Lrvk6LS8edGfI2hhhGN8KEsOMpKHvGQvNCtnJ1gxUzOxByySWiYvuIOfe0WSkHECC0gn9XNU3NMLwqFz9RPNQ3JgjLkYDEn5xhx24A+z/cEx4TCnKdWP3v8/gfPjkFs1CwO+g+e3y0GLHPDa5Wi30ThvaiazctU4iAV+D0f5u9O3u3bAoRsWRxkU8FvUDMwdmL03WColQLgtFrQTDtJhMsgQaO0zjpiJi1R2ST1L6J+jQPIZyKascA9KZ1bq4Cboq3xuJBmVeLxUZiPZUrOD0EMY7+VGuJ+ha7C3JcNAiwDhXZHvovLEko0Z3y8/QaO2VqgrJt2u3jzsfMEwK5bTk8FlAftZ3IH0IlUNxIRYm1IW6QjiopflUUJsUm3WXCA/jvXDT3hYMMx5LFEO3mA3W/nAMvZ4+3/qFQie8TM1gifojMHzv+C8pRJp+M2A4rVyJumzQ== 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: 042a046c-ffdf-4da5-8be6-08d862971307 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2020 03:40:27.1272 (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: JoMGdOYYs3pJpJvvdvbypmbXotwv96qbNdb9wbPUNj9ZVXhTKitesSJjGLX6ZLBJitSQbxllBoYY3pQFaU7+SA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR21MB1859 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MW4PR21MB1857392CE4AC02440250A679EF340MW4PR21MB1857namp_" --_000_MW4PR21MB1857392CE4AC02440250A679EF340MW4PR21MB1857namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I=92m not opposed to it, but I think our team would suggest that it=92s a g= ood use of a multi-repo solution where each repo can have its own enforced = style. What would your thoughts be on that? - Bret From: Andrew Fish Sent: Friday, September 25, 2020 7:52 PM To: Bret Barkelew Cc: edk2-devel-groups-io; Ken Taylor Subject: Re: [EXTERNAL] [edk2-devel] ECC: Won't somebody PLEASE think of t= he... test structures. Bret, Details aside this ECC issue got me thinking it might be useful to some ho= w tag code that follows different, subsetted, or alternate rules, or uses d= ifferent build environments. I was kind of thinking of doing something like= how we tag the licenses in the header comments [1]. I would say nothing me= ans edk2 rules. I can see vendors maybe having different internal rules, or= us wanting to distinguish test code from production code. The general idea= if we start this tools can be smarter and that seems like a good thing. This is just a wild idea, so I=92d like to see what other people think? [1] SPDX-License-Identifier: BSD-2-Clause-Patent Thanks, Andrew Fish On Sep 24, 2020, at 7:57 PM, Bret Barkelew > wrote: 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 > 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 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_MW4PR21MB1857392CE4AC02440250A679EF340MW4PR21MB1857namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

I=92m not opposed to it, but I think our team would= suggest that it=92s a good use of a multi-repo solution where each repo ca= n have its own enforced style.

 

What would your thoughts be on that?

 

- Bret

 

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

 

Bret,

 

Details aside this ECC issue got me thinking it mig= ht be useful to some how tag code that follows different, subsetted, or alt= ernate rules, or uses different build environments. I was kind of thinking = of doing something like how we tag the licenses in the header comments [1]. I would say nothing means edk2 r= ules. I can see vendors maybe having different internal rules, or us wantin= g to distinguish test code from production code. The general idea if we sta= rt this tools can be smarter and that seems like a good thing. 

 

 This is just a wild idea, so I=92d like to se= e what other people think?

 

[1] SPDX-License-Identifier: BSD-2-Clause-Patent

 

Thanks,

 

Andrew Fish



On Sep 24, 2020, at 7:57 PM, Bret Barkelew <Bret.Barkelew@microsoft.com&= gt; wrote:

 

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.<= /p>

 

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 <= /span>

 

From: = ;Andrew Fish
Sent: Thursday, S= eptember 24, 2020 7:48 PM
To: edk2-devel-groups-io; = Bret Barkelew
Cc: Ken Taylor
Subject: [EXTERNA= L] Re: [edk2-devel] ECC: Won't somebody PLEASE think of the... test structu= res.

 

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@grou= ps.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_MW4PR21MB1857392CE4AC02440250A679EF340MW4PR21MB1857namp_--