From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.109]) by mx.groups.io with SMTP id smtpd.web11.5799.1601000720513296352 for ; Thu, 24 Sep 2020 19:25:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=KDGnxGnw; spf=pass (domain: microsoft.com, ip: 40.107.243.109, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ftBFQW9tRaXKA3Y24WfXBbmrWpdZ5fhwWwx3S36muh+O7/29zqeDQIUWXvHIdHNwz9o+T1MhuoSqJpnO4mntk5+N+TC17J75iTZL4nRmdMiPxHUxHcoBZ+bd9huk/fT/6QPIlRYhHqpA9nvAJTEcykau0ISqX/FFIIpqvcxcyZgHsbrC/5KZSYyEj7HTJ0Xg4gIY5WKAEhjdA0Qy3AJMZhpLILjopnAJ2GR4XflGWRenZOSsnP/1eu9C3OgyXmwoX+NmP+hjLWwFWLnKtH7Zjtb/OJsta7gyvJ2pWNkc/C1k3RuX63ASNNTR4cYAXXWMz2cv4QiCnX8KK5f4SC3c7Q== 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=y2IHocdWfDKDQpYmZIIMRlhkOml6hULUQaEPrCIZS30=; b=oCgejmhlV//YTZtSptyLfJG2d6DxM4WiJr7d2r6z6EEYRHuCAewp7H4/qK1/UgY0pUD9/HVs6xfyBVJspnVvEcHUYKdbCeOlv/XhgXkKqdmgQafk8TQYWjMj69FBtABKV/Q/Y6FqkRPLuEG0+W9dc891V4DN7dvIYnkPoH3aGO0T2JMNnf6LrXK5IzThawSf15ujQSITRSIT2PeJj9ZpdgQ6x75ZdgafXdgW1r8VmuvbgsvgXb/5VZY6SzR805+iYFsV8wBUgJUySBnEiY29FZIxTMT5UoG/mR5ipntiYcleRkqbf9Q7v2LLHquejao03ahSU9hm5Wb9nO9mL0e9pg== 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=y2IHocdWfDKDQpYmZIIMRlhkOml6hULUQaEPrCIZS30=; b=KDGnxGnwrEx56oPwNkZYtROhrb39cTI5ITdRaPqqEtWO+rwS5d0h0qsXmFkolNrp/EE39X5cWo/ZdOb+bTcCfuvlqj4a9ncgA3C1qoSE6lJ4SUAK1OQaZLbamdlQdNw2tm32wAIUavPFLiu9O0t4qNuq68BjJeeBQ5Rw+HGX3MQ= Received: from MW4PR21MB1857.namprd21.prod.outlook.com (2603:10b6:303:74::12) by MW2PR2101MB1052.namprd21.prod.outlook.com (2603:10b6:302:a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.1; Fri, 25 Sep 2020 02:25:17 +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:25:16 +0000 From: "Bret Barkelew" To: Ken Taylor , "devel@edk2.groups.io" Subject: Re: ECC: Won't somebody PLEASE think of the... test structures. Thread-Topic: ECC: Won't somebody PLEASE think of the... test structures. Thread-Index: AQHWktooEicGg8j40UW1Z0xLUDeoV6l4lrAQgAAJNUo= Date: Fri, 25 Sep 2020 02:25:16 +0000 Message-ID: References: ,<29096719f8d541c3aa25f9738a61b1d3@SCL-EXCHMB-13.phoenix.com> In-Reply-To: <29096719f8d541c3aa25f9738a61b1d3@SCL-EXCHMB-13.phoenix.com> 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:23:04.7095791Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: phoenix.com; dkim=none (message not signed) header.d=none;phoenix.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: 6828925b-2c6e-42f6-7a9d-08d860fa3de7 x-ms-traffictypediagnostic: MW2PR2101MB1052: 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: 7Dqp/dx4EszzcX7v0c9LBHS0OXfx4zc8lwASMwSEuBwmwj5m9VcNlVDzI9N6ZEdqs/ANpMqMUAujqGGDQ3acoeVWB2m3GbaGYMksOwxUehuQ7iCUfAm1WZ81r6/L/sumDuRoTaKqXG3aD5RmJLlkFtzVECvu4gfHTnPL4bwLTZlZnvR4gDh6KsWyBrw1+g/O7IuuQZwMZtW+gTEd28Ix5KLx9lB0PlVmjncteBJWn4wK3L5YIDtJIJF+2fE99e8N1D0DnvNnfZ0Qr7dB6OYoLAqwCID7ao+GnnjkrDyThNLUjhainLHKmKR69ke0olSK+tyi894qNRxh2Drqh4Om9ST6n0xniyX2GkOFLEA4vgCeiGpyMXfYl6M0SWowtBQZ4qJvtJSCVJmtN2yOzbR87jIRbf+BJoOtobZi5UBZF2rIdri3ZGg94U7fb9GbuBWb1acHqcvVwDfKg48D4jt6HA== 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)(136003)(346002)(39860400002)(366004)(396003)(86362001)(9686003)(55016002)(8676002)(2906002)(82960400001)(99936003)(83380400001)(64756008)(186003)(110136005)(66446008)(66946007)(10290500003)(52536014)(76236003)(8936002)(316002)(82950400001)(66616009)(5660300002)(33656002)(7696005)(71200400001)(166002)(76116006)(8990500004)(66556008)(66476007)(478600001)(53546011)(6506007)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: WdPO5wBAc3IiMmO3yRTv5lFKoVpTLCpqrCbFVnedRCCePnz/PtoZV0NRohsyzjKTCWD89+s/2z8lTay689qUVABX7Tv7nttV9YyaZY2SuiBJaYVyIsUlzTutiZrEVxWcDOrJAZcsrS3ccbGYBwy8NHt7RJwU1aiXDpWkiwJIbhO1odHokQDnWqrwA0xc0CxEkjFOyS+xAHKP5a1JcpL8CvvDMHrUmgdUjpscBwdC935+Cgr+qHSGVZQoz9wylQCW916SrK4bnUuGE5qs+F1GDA9ctk9e1L6RHGt5k4+WNJLh6KnjrWcunflf1cHc1jCOkNI+X+Tc3x8Hk5TrWUWPM+gt4QeCZyNMl1Hucr80vEgW+miKbtCJEAm2paH1Zk1JeVAPpi/lUQoSr1YD/hBygNmgtLWoJ1h2BnA5UgFCj6LLJeZee8iQJwa15OqGEGFa2emBq5ntCiPwGkWaMlm4xwFt0iiX6yRHjMeE1f0qdKwyIplOUWvFS4mBTwFZdkGuwcx7LuG7ja7WkGgcbp+RG+yAzpAwj/9WFQR9o/sBBMy2EgE+FkPjEQ2mZ80Ge8muKW2QSYEDXzkQ0utG9dXe/oSGtTqjuNQVaiTVVfOMpLG2aq8jIl9F8zAlzmEzgvAfEy5e8Pq3+UNXxlzZHKJ8iw== 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: 6828925b-2c6e-42f6-7a9d-08d860fa3de7 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2020 02:25:16.8251 (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: GZ14jpzU52uSfcjfmA27gqalVQ1fLZDagvrdd7Bj/clYXibSOb0L7eph1XcqhEws7JTNsEEyDMFm0N8TnLUDtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1052 X-Groupsio-MsgNum: 65599 Content-Language: en-US Content-Type: multipart/related; boundary="_004_MW4PR21MB1857F3476D241BFDC4C5ABA3EF360MW4PR21MB1857namp_"; type="multipart/alternative" --_004_MW4PR21MB1857F3476D241BFDC4C5ABA3EF360MW4PR21MB1857namp_ Content-Type: multipart/alternative; boundary="_000_MW4PR21MB1857F3476D241BFDC4C5ABA3EF360MW4PR21MB1857namp_" --_000_MW4PR21MB1857F3476D241BFDC4C5ABA3EF360MW4PR21MB1857namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable 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 --_000_MW4PR21MB1857F3476D241BFDC4C5ABA3EF360MW4PR21MB1857namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

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

 

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 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,

-Ken.

 

From: devel@edk2.groups.io [mailto:de= vel@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... te= st 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

 

 

--_000_MW4PR21MB1857F3476D241BFDC4C5ABA3EF360MW4PR21MB1857namp_-- --_004_MW4PR21MB1857F3476D241BFDC4C5ABA3EF360MW4PR21MB1857namp_ Content-Type: image/png; name="95B370A7BEED49AAB797022E8F260C8F.png" Content-Description: 95B370A7BEED49AAB797022E8F260C8F.png Content-Disposition: inline; filename="95B370A7BEED49AAB797022E8F260C8F.png"; size=151; creation-date="Fri, 25 Sep 2020 02:25:16 GMT"; modification-date="Fri, 25 Sep 2020 02:25:16 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAsQAAAACCAYAAABfe8oDAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAsSURBVFhH7dYBDQAwCASx928KBVOAGEhmg15S D5d6PQAAcNUf4kiSJEknSxbqaWoGh41h5wAAAABJRU5ErkJggg== --_004_MW4PR21MB1857F3476D241BFDC4C5ABA3EF360MW4PR21MB1857namp_--