From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.10486.1584023660512719641 for ; Thu, 12 Mar 2020 07:34:20 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=034068b444=abner.chang@hpe.com) Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02CEXadY018737; Thu, 12 Mar 2020 14:34:18 GMT Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 2yqm479kv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Mar 2020 14:34:18 +0000 Received: from G4W9119.americas.hpqcorp.net (exchangepmrr1.us.hpecorp.net [16.210.20.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3426.houston.hpe.com (Postfix) with ESMTPS id 6159481; Thu, 12 Mar 2020 14:34:17 +0000 (UTC) Received: from G9W8456.americas.hpqcorp.net (2002:10d8:a15f::10d8:a15f) by G4W9119.americas.hpqcorp.net (2002:10d2:14d6::10d2:14d6) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 12 Mar 2020 14:33:29 +0000 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (15.241.52.11) by G9W8456.americas.hpqcorp.net (16.216.161.95) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 12 Mar 2020 14:33:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/oDXuDiK+OfVCSanIemblm8zF3PAo6DQP2IeGPa5VPU7NkItqEUgik70bxTRdK+6VMd3WuZLyvU39eY+rUowdxCkhflOR3yvOvHwl6SJJyxT5erXg4T5LmQpFd2KBxIc5OMfsv/5mHD/+zsoD1XGdiqr5/ZIenqblOxeB2ipa1mAcEeMWPXOkKn24W6WvGM3w/4DkYYIfAgy6ruLNB4Uhpb6QTYlN7byfjhT11PTOfQqgipEWl1NWbryJ7MhgpUwPUNSvnDOLLS0dverIkZuuzuTPU+1LIQue/TtGJ83LrWIdilFMK84IEZIJkegLMXu0IBUXW6PSrY1xtZVNfunA== 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=sSRnqv+XTdcYMKcdUDzfaB4Kq6GYOFvyXBLXF7Dr25A=; b=YQDf0J5OQnFjff87UhLVnhMuCzRJtNdaK4w5tXGUiUUYG1gQpUcnpgiq0hJWX1/YG7BMBZgR/Fmz0ctjGUnd++9xbwMmMDpEsLiHQjGsg+pZR0I2Pp051Lk8XINeH6DU+zIPj9UIn1XcNNx79YR8m8nACx6idQiuWyVe7FkkKJOtGXiKTaltG1Anbk3Y73bIBkZvUfzsngA0K8GMX7rh0kKgKrLuZotjVbIMILCh9xbwANXMtLg67TfsRHClJxM6wJ9CFFfVuYB0SWNpaqr3zdXQIWalKnc0D6gwiQSWxWjRDJ5uIxZgg9pNE4z8zHlmpVj920c6+nj4cGjdy5JSwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from TU4PR8401MB0429.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:770a::14) by TU4PR8401MB0573.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:770b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16; Thu, 12 Mar 2020 14:33:27 +0000 Received: from TU4PR8401MB0429.NAMPRD84.PROD.OUTLOOK.COM ([fe80::b0b5:c067:8f22:a402]) by TU4PR8401MB0429.NAMPRD84.PROD.OUTLOOK.COM ([fe80::b0b5:c067:8f22:a402%6]) with mapi id 15.20.2793.018; Thu, 12 Mar 2020 14:33:27 +0000 From: "Abner Chang" To: Leif Lindholm , "Schaefer, Daniel (DualStudy)" CC: "devel@edk2.groups.io" , "Chen, Gilbert" , "afish@apple.com" , "michael.d.kinney@intel.com" , "pete@akeo.ie" , Ard Biesheuvel , Laszlo Ersek Subject: Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem instead of GUID assignment Thread-Topic: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem instead of GUID assignment Thread-Index: AQHV8H3y8ONhWG4a20uPbA3rSjizB6hE2H8AgAAppACAAArJAIAAAoZw Date: Thu, 12 Mar 2020 14:33:27 +0000 Message-ID: References: <20200302103238.25726-1-daniel.schaefer@hpe.com> <20200302103238.25726-4-daniel.schaefer@hpe.com> <20200312105528.GC23627@bivouac.eciton.net> <539c8673-786c-9c58-98cc-ab470b345740@hpe.com> <20200312140304.GF23627@bivouac.eciton.net> In-Reply-To: <20200312140304.GF23627@bivouac.eciton.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.242.247.131] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 7c8b451e-dcde-4f51-e975-08d7c692542b x-ms-traffictypediagnostic: TU4PR8401MB0573: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1265; x-forefront-prvs: 0340850FCD x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(396003)(376002)(136003)(39860400002)(199004)(86362001)(9686003)(81166006)(53546011)(5660300002)(110136005)(54906003)(8676002)(66556008)(966005)(4326008)(66946007)(66476007)(76116006)(64756008)(81156014)(33656002)(19627235002)(66446008)(6506007)(52536014)(186003)(55016002)(8936002)(316002)(478600001)(26005)(7696005)(6636002)(71200400001)(2906002);DIR:OUT;SFP:1102;SCL:1;SRVR:TU4PR8401MB0573;H:TU4PR8401MB0429.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pJfuOG0KJLwTZeq+VUhFOYNA9kpBCdwnDnyIYbcUGwGA6++xv8VNvv7mvqZpRbilxaFbhmqxj9W0ssfUygHPD1nLQXOXSaGQR09ele9RPfxjpsvP3+dngX6/sjirA6NO+9J8Yx1sFGrw7a3UrBo2KPVPMtFdVP2Me51tTZzG8kFeGh0Y+DHqP9Yvd5ol0G4UCLVSqfYEzJio8ETBmeanUD3mN9D68sj2LT0PRlYcsPLD5jQv7NeXcQL8t2PYHhpGyDHI+4+y/k2AjVOjVO1m4zUwhUi51loKpiiKPjnVEhcpDrr8wF9Hc/HxLd0V/HMWsPpNC/6cht0/kpqNq6u3kv3GCOdbglAheCdfPkIjk3h4dWQWDnqFDRk/QSWcHr5sjdnoByRphbu7+SZleF+j+pNBNWMGCTeS4peE/gs9ya+ebVB0IAXKny+1aU0Y3aREMeyD69csb1axK4woQfNesJ2gFS+JGz8NsA6fL3uEDXTiWwLoUgydeU6PigvXOzM4rDH/Zw8UycumHJWfd8Oruw== x-ms-exchange-antispam-messagedata: Ew1b+KAwixd1L0k/GN4gAOBgstLF0Yk2K/3Ak//3uQOnVH3Z2HCwcTI5IPKgLcYR1HGL6dF5sx2dra9vb+CfYrhvu3FVgy7LrbLwOFR/g/vtui9rla1m654VFZLhJjagZwvSAXcGNCHxmj1ufSEkIA== X-MS-Exchange-CrossTenant-Network-Message-Id: 7c8b451e-dcde-4f51-e975-08d7c692542b X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2020 14:33:27.4733 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0PSs3h2HqAmIahXSUzz1a3Z+jK755Dm1KWH6NqYLprei8TdgF9NRKe7fOwkicYxwnw6pR9uIw2Z7SKhxQkwgmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TU4PR8401MB0573 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-03-12_06:2020-03-11,2020-03-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1011 adultscore=0 priorityscore=1501 phishscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003120079 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I don't prefer to do this at this moment, Leif. I have no problem if we cre= ate a BZ for this and create BaseCompilerIntrinsicsLib in MdeModulePkg, but= please don't bind it with RISC-V EDK2 port. You know my concern pretty wel= l, we can't hold those RISC-V patches on hands like forever and address the= code structure optimization. We can still work on BaseCompilerIntrinsicsLi= b but not part of this RISC-V submission. We can implement RISC-V variant i= f necessary after RISC-V edk2 get in edk2 master. Abner > -----Original Message----- > From: Leif Lindholm [mailto:leif@nuviainc.com] > Sent: Thursday, March 12, 2020 10:03 PM > To: Schaefer, Daniel (DualStudy) > Cc: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > ; Chen, Gilbert ; > afish@apple.com; michael.d.kinney@intel.com; pete@akeo.ie; Ard > Biesheuvel ; Laszlo Ersek > Subject: Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem > instead of GUID assignment >=20 > +Ard, Laszlo. >=20 > I think it would make sense to move it to MdeModulePkg (or MdePkg) and > rename it BaseCompilerIntrinsicsLib (it *is* a BASE library). >=20 > As I alluded in my reply to Ray - x86 also have this problem, but to a l= esser > extent, and ended up creating library functions to call instead of using= plain C > for certain operations. > Which was probably the right decision when it was restricted to a very f= ew > corner cases. >=20 > / > Leif >=20 > On Thu, Mar 12, 2020 at 13:24:30 +0000, Schaefer, Daniel (DualStudy) wro= te: > > Hi Leif, > > > > you're right. If I revert my commit and include > > NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > > without making any changes to it, the build succeeds. > > > > What do others think? (cc Michael, Pete, Andrew, Ard, who have made > > changes to this module) Is this a big hack or should we use it in RISC= -V, too > and move the module to MdeModulePkg? > > Why isn't this a problem on x86? Was it fine on Itanium? > > > > - Daniel > > > > ________________________________ > > From: devel@edk2.groups.io > > on behalf of Leif > > Lindholm > > Sent: Thursday, March 12, 2020 11:55 > > To: devel@edk2.groups.io > > ; Schaefer, Daniel > > (DualStudy) > > > Cc: Chang, Abner (HPS SW/FW Technologist) > > ; Chen, Gilbert > > ; Dandan Bi > > ; Eric Dong > > > > Subject: Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem > > instead of GUID assignment > > > > Hi Daniel, > > > > There is nothing wrong with this patch that just went in (and I should > > have called out sooner if I wanted to stop it), but I think a better > > solution is to implement a RISC-V variant of > > ArmPkg/Library/CompilerIntrinsicsLib/. > > > > It is perfectly valid for the compiler to generate memcpy calls in > > response to struct operations that are perfectly valid C. > > > > In fact, we could consider moving the ArmPkg one over into > > MdeModulePkg. I have a feeling that including a > > NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf > > in your current build would be an alternative solution to your > > compilation error. > > > > / > > Leif > > > > On Mon, Mar 02, 2020 at 11:32:38 +0100, Daniel Schaefer wrote: > > > GCC translates a simple assignment to memcpy, which EDKII doesn't > provide. > > > See: > > > INVALID URI REMOVED > 2Darch > > > ive.com_edk2-2Ddevel- > 40lists.01.org_msg11928.html&d=3DDwIBAg&c=3DC5b8zRQ > > > > O1miGmBeVZ2LFWg&r=3D_SN6FZBN4Vgi4Ulkskz6qU3NYRO03nHp9P7Z5q59A3 > E&m=3Dwjlf > > > > QYZsXfc5WWDFmywLOEYlCKvrpYrnaXMIpJcLK7U&s=3D426yv7VvgHTtgtYaR0f0X > NiaEA > > > LgqZkxektjywEwPco&e=3D > > > > > > REF:INVALID URI REMOVED > > > anocore.org_show-5Fbug.cgi-3Fid- > 3D2547&d=3DDwIBAg&c=3DC5b8zRQO1miGmBeVZ2 > > > > LFWg&r=3D_SN6FZBN4Vgi4Ulkskz6qU3NYRO03nHp9P7Z5q59A3E&m=3DwjlfQYZsX > fc5WWD > > > FmywLOEYlCKvrpYrnaXMIpJcLK7U&s=3DPjC_mIwh0GhNy5np2h7K8l4l- > pLLBWt1FRuLB > > > UbULpc&e=3D > > > > > > Signed-off-by: Daniel Schaefer > > > > > > Cc: Abner Chang > > > > Cc: Gilbert Chen > > > > Cc: Leif Lindholm > > > Cc: Dandan Bi > > > Cc: Eric Dong > > > --- > > > > > > Notes: > > > v2: > > > - Use CopyMem instead of CopyGuid [Dandan] > > > > > > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git > a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > > index 5cc527679a78..0540e6fa8a44 100644 > > > --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > > +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > > @@ -619,7 +619,7 @@ CreateDeviceManagerForm( > > > TokenHelp =3D HiiSetString (HiiHandle, 0, String, NULL); > > > FreePool (String); > > > > > > - FormSetGuid =3D ((EFI_IFR_FORM_SET *)Ptr)->Guid; > > > + CopyMem (&FormSetGuid, &((EFI_IFR_FORM_SET *) Ptr)->Guid, > > > + sizeof (EFI_GUID)); > > > > > > // > > > // Network device process > > > -- > > > 2.25.0 > > > > > > > > > > > > > > > >=20 > >