From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.7630.1584071851151212443 for ; Thu, 12 Mar 2020 20:57:31 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0341df3555=abner.chang@hpe.com) Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02D3v7JN025702; Fri, 13 Mar 2020 03:57:28 GMT Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 2yqxtp9e8e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Mar 2020 03:57:27 +0000 Received: from G2W6309.americas.hpqcorp.net (g2w6309.austin.hp.com [16.197.64.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5008.houston.hpe.com (Postfix) with ESMTPS id E5B1353; Fri, 13 Mar 2020 03:57:26 +0000 (UTC) Received: from G9W8455.americas.hpqcorp.net (2002:10d8:a15e::10d8:a15e) by G2W6309.americas.hpqcorp.net (2002:10c5:4033::10c5:4033) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 13 Mar 2020 03:57:26 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (15.241.52.13) by G9W8455.americas.hpqcorp.net (16.216.161.94) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 13 Mar 2020 03:57:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KnAEHxOPXCC2ecYoSJhNYQA56ICAQqQZK7JhYL0MIQTK73xyyVT0ZC/TcqKGQRyU2IPAfTxqPL7TC03sYNASk5ei7e4F8PGN+DF6/yAJrrROhvdnoQkD9wPxT6hLZymvmF4v8rF5lddJZ4PpQyQiD8eNjybo0eGUW0KCqAGC9KdLjI60hi72x+wrOxof5P43Hh+mzlOohu01Ad+sy9h7pRzABBpSdTSAbdQr+GkMg5af5tdQsZQGU9ChBat5SrHz9GFtd5clTWGNoPtuOdFtXxSaATFA7/WQirJZADUZTpslHjXyHHd3WBOgKI19pSvBoftt4GKHB/E8EEF5TJkbAA== 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=9OnPoy5/EwiTJQV2MVd+LWnKrQTrurpzh+qGKsr0Hfs=; b=c1HpnslB2WOLGtPwMuF27u+zwawzTmBBz8GqipomKmEUL8Cn0Jqpdh0TszBtjVIox+X5P4bRff5pXvgtMl3MG3oOv0nKZY+w0jSiGUSrOKJGW7Qzv04QYhTKH9U+GEkoTac98L8KoQnx8VkhJEHjVzZCXMV7b2xc+enzdc/6ekOi9aIwXwXxmN5P6BPUWnmAQex+JfE3vZN1nt3DVmTdaLa5n1LQxusV9GGgl/wwt8wslCJYjmuQ1xPyqt+AV7+zlY55JoKG1Ko91oZbW+8TvvvahxU8phOcAEr1dtpqEKLck0h27fX3muBV+jz/cOVrcNO44nwLSN89iP55Az7mBg== 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 TU4PR8401MB1294.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7715::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Fri, 13 Mar 2020 03:57:25 +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; Fri, 13 Mar 2020 03:57:25 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "leif@nuviainc.com" CC: "Schaefer, Daniel (DualStudy)" , "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: AQHV8H3y8ONhWG4a20uPbA3rSjizB6hE2H8AgAAppACAAArJAIAAAoZwgAAJJQCAAANpAIAA2epg Date: Fri, 13 Mar 2020 03:57:24 +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> <20200312144452.GI23627@bivouac.eciton.net> <20200312145704.GJ23627@bivouac.eciton.net> In-Reply-To: <20200312145704.GJ23627@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: 9250cace-a7d8-4583-8c91-08d7c702a3f6 x-ms-traffictypediagnostic: TU4PR8401MB1294: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1265; x-forefront-prvs: 034119E4F6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(396003)(136003)(366004)(376002)(199004)(55016002)(4326008)(26005)(71200400001)(9686003)(33656002)(66556008)(64756008)(66476007)(52536014)(66946007)(76116006)(66446008)(5660300002)(81156014)(7696005)(8676002)(8936002)(19627235002)(316002)(2906002)(81166006)(966005)(6506007)(478600001)(86362001)(186003)(110136005)(54906003)(53546011);DIR:OUT;SFP:1102;SCL:1;SRVR:TU4PR8401MB1294;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: x3+kjh73Bbml4zSYdn6Gj1koOiOCcyiCX9A3X+owSPAnL5So0LdRKDa17C4hBVlpF+gDIkWWt9wkvWXNO5Bc6hwba5jcjEmw/vov4dknzEaAKunoJuz9zlnqMVbBtjmatp5TDUI0KnuuhiVW8S2CvV5gi3AhoH9NlfQbkAp+yMGxKVK5S49l/hxrhZHUV2gB+sjTxN8dwdmejqCxe7Y6NCOc4ICk8quqV6q0Giq+kaBS1QBUOsFFGXE3Px1JWUYCIEjtwQSCCSaiLIqP/LZTf4E+NsSwD3SUkJcLULEw0GkfHkU/0zIIb6naXpRgp0qTSlP/WKk5ub8ajL04BaAuz/NGssuREsqevC+RzHybuhJYU4u+BYN/B6Xh6MzmDtvAB31AxoKMNEg8XmMe14AWJs+n9ehOTjDS5j9UfJTSjlEYtYe5uG6cZnGz79JoFxsBwkUkq6XG3Ek4niknaVRa9aiZAd4TJ/uDSLfNco6L4UhJLpH0RSpvLn7XruRoOxgt/qKe8UHOP+fhZtlKxVZT9Q== x-ms-exchange-antispam-messagedata: edk2a1XTyYtA7yZowqoM3vMC2WnK30O1KfQKqsoFXRjioIaXOxkoWaWrNEKU1LKbzfXhFeIyA2gbx6ZAZkhCIEPysqUyhGkMf3NGBe1siP99XqeSLaQLfIEpnwrx/NFXzsvBfCl61PVcgTCnI9H6XA== X-MS-Exchange-CrossTenant-Network-Message-Id: 9250cace-a7d8-4583-8c91-08d7c702a3f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2020 03:57:24.9701 (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: ftaEesA1xTQvotWPVzxHDbnPeLQ2YlXB+4jE/8E17Jsic88DUZdAaeTd0sF/K54wZFpTMZwLjf8d/gFxFm1uIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TU4PR8401MB1294 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_19:2020-03-11,2020-03-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 impostorscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003130020 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Leif Lindholm > Sent: Thursday, March 12, 2020 10:57 PM > To: Chang, Abner (HPS SW/FW Technologist) > Cc: Schaefer, Daniel (DualStudy) ; > 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 >=20 > For clarity, I'm suggesting *I* take care of moving this into a generic = Intrinsics > handling lib, and that HPE take care of including and using it. Great to hear this. >=20 > I'm also not suggesting we revert the CopyMem patch before that is > complete. >=20 > On Thu, Mar 12, 2020 at 14:44:52 +0000, Leif Lindholm wrote: > > And what would you propose we do the next time the RISC-V toolchain > > generates a memcpy call based on some other completely valid change to > > core code? > > > > Doing this de-risks the RISC-V upstreaming effort. > > It's also a trivial move/rename opetation - the only question is where > > the library should live and be called. > > > > / > > Leif > > > > On Thu, Mar 12, 2020 at 14:33:27 +0000, Chang, Abner (HPS SW/FW > Technologist) wrote: > > > I don't prefer to do this at this moment, Leif. I have no problem if > > > we create 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 well, we can't hold those RISC-V patches on > > > hands like forever and address the code structure optimization. We > > > can still work on BaseCompilerIntrinsicsLib but not part of this > > > RISC-V submission. We can implement RISC-V variant if 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 > > > > > > > > +Ard, Laszlo. > > > > > > > > I think it would make sense to move it to MdeModulePkg (or MdePkg) > > > > and rename it BaseCompilerIntrinsicsLib (it *is* a BASE library). > > > > > > > > As I alluded in my reply to Ray - x86 also have this problem, but > > > > to a lesser 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 few corner cases. > > > > > > > > / > > > > Leif > > > > > > > > On Thu, Mar 12, 2020 at 13:24:30 +0000, Schaefer, Daniel (DualStud= y) > wrote: > > > > > 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, NUL= L); > > > > > > 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 >=20