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.web11.9257.1584019477662292979 for ; Thu, 12 Mar 2020 06:24:37 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=034020df80=daniel.schaefer@hpe.com) Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02CDCYDF002774; Thu, 12 Mar 2020 13:24:34 GMT Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0a-002e3701.pphosted.com with ESMTP id 2yqkh199s2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Mar 2020 13:24:34 +0000 Received: from G2W6310.americas.hpqcorp.net (g2w6310.austin.hp.com [16.197.64.52]) (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 6731271; Thu, 12 Mar 2020 13:24:33 +0000 (UTC) Received: from G1W8107.americas.hpqcorp.net (2002:10c1:483b::10c1:483b) by G2W6310.americas.hpqcorp.net (2002:10c5:4034::10c5:4034) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 12 Mar 2020 13:24:33 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (15.241.52.11) by G1W8107.americas.hpqcorp.net (16.193.72.59) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 12 Mar 2020 13:24:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gdDL9wyVsZ+Up2FOxSmwjApHwcAjI/HZFmJkPA2atuoFI83C8Vwp8GUtPeysdnQ4afT2SESmwnQQWJshcT/NmY6QDr6cvPYMxnSneQZ4f4iuKhP/FEewPwK+2cNq4Ky6U8V3wCTyQbt7f/A4pydYjihWkjD52KgW22APcl5o22hoDQbHzmvDu3x4e+gBWXYlERGA+DP9EmfjcKUqw9pYNKoVy6HBiy9LT+vNmVz2MfzMppaXvmRFAhea/icp1e48wlXm4ma+C7dCmRDOGTxScgrHrAgPye1knEMC61m0JIXL0XVGZRtMg5A78I8VMIZmmdWWBStsWQCQRAwI60g4pQ== 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=q/0+xSNftOvfGNs2krj16zkLHTAwR4K3hJ9+zt6uQzk=; b=SiEEyOcJsWDKO6rLCv4WjuMSGLnXGJUOFVX+/gMHMwlxan/76GSgyQf8AIE70rXsRjm2la1TDezpN/nMJiyNmbifQN07wBzhc1zXYJ4JkSYRQibT305k/byylK8XUIkuJ5+MkUhAaGrOqeCGshcminFQf+FXpJaWmEB2GZlo4EMERiF+avzFF57Y9DQtqqS/CpXOj1meBlfX+cf2lCRA3XzMc88AZ6pLprnvrTL3rAhIiOsHZc3kxFFbhsk6ZANj9xSjHTDjjWDSqRmOoHvkWqR6IZ9i89ANc7kpka5UHvVC4mhRSKyFsZH1VXnfJfGx+ZFfPAuKTlOVupE+oo92tQ== 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 AT5PR8401MB0596.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7428::12) by AT5PR8401MB0930.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:741e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Thu, 12 Mar 2020 13:24:31 +0000 Received: from AT5PR8401MB0596.NAMPRD84.PROD.OUTLOOK.COM ([fe80::ece8:55ec:e407:15c1]) by AT5PR8401MB0596.NAMPRD84.PROD.OUTLOOK.COM ([fe80::ece8:55ec:e407:15c1%6]) with mapi id 15.20.2814.007; Thu, 12 Mar 2020 13:24:31 +0000 From: "Daniel Schaefer" To: "devel@edk2.groups.io" , "leif@nuviainc.com" CC: "Chang, Abner (HPS SW/FW Technologist)" , "Chen, Gilbert" , "afish@apple.com" , "michael.d.kinney@intel.com" , "pete@akeo.ie" 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: AQHV8H3ySyPUKl5ns0CfBTUEYnxrXKhE2H8AgAA6OgA= Date: Thu, 12 Mar 2020 13:24:30 +0000 Message-ID: <539c8673-786c-9c58-98cc-ab470b345740@hpe.com> References: <20200302103238.25726-1-daniel.schaefer@hpe.com> <20200302103238.25726-4-daniel.schaefer@hpe.com> <20200312105528.GC23627@bivouac.eciton.net> In-Reply-To: <20200312105528.GC23627@bivouac.eciton.net> Accept-Language: en-US, de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-imapappendstamp: AT5PR8401MB0596.NAMPRD84.PROD.OUTLOOK.COM (15.20.2814.005) user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 x-originating-ip: [84.58.209.92] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 0230d382-53be-4096-3fbd-08d7c688b2a3 x-ms-traffictypediagnostic: AT5PR8401MB0930: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1169; x-forefront-prvs: 0340850FCD x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39860400002)(136003)(346002)(396003)(376002)(199004)(19627405001)(53546011)(6512007)(6506007)(31686004)(8676002)(81156014)(81166006)(8936002)(2906002)(86362001)(316002)(4326008)(478600001)(54906003)(966005)(31696002)(110136005)(6486002)(76116006)(91956017)(66946007)(5660300002)(71200400001)(66476007)(26005)(66556008)(64756008)(66446008)(36756003)(2616005)(186003);DIR:OUT;SFP:1102;SCL:1;SRVR:AT5PR8401MB0930;H:AT5PR8401MB0596.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: rM0NFlji4BWGgVaPAC7CLo3CdwZAA0PsTdXPd5yr/L9nkdeXfj6d/gsWrtpAAHpcx6QxXacVGqa+AaRKLQ1UOQwZz07iIWvobbpBwePBluDifijTravA5h1kutI3W2FQZuRUvq6DGOAQybC6Y0yoNYEbeLpcSFtwKT1je+uiDLUaUOFYUbEVBzO1WVNusIBaAPS4nkU5VuIugK7Y+tcmH2Ev+RhnGwoRkzY88Q/CcOiWEdv573f3NU04v5LkPjkmh1LPkfTajKe4mJ8s3ctHU7a9j9rmHzHRxwviwTFIB7EbVx0QOEYeV4pfvHKKVohO0PuWkgcDYlbK1S4UJ7+06NsOS8WSXjulewQ+0A+uYX9EpHm1KJBGTRNgqHppvF7l3VF+qjg4L3g4D+AnuJ2kyEFyBvM1QyarGRcOcRgMN5xLKfGPCeZaRBbVjkBQQvOOyippyESJG33UsvB2qwi0nFt2OEkpKGny9pmzdLfMgIgPDUHyOoxHkY4Obp8bjc5LP61iZDbteiQYy8z4mY1rJw== x-ms-exchange-antispam-messagedata: jT0HMOzF85sm8hM+uQiZLGA7Xe99e8UrTOHh7YcuGyzlpIskI8k9ux0nhFXvN1ZCVIJcz6GOAEu0Emg/upwPSfmMs1bPGkR0SsbHe+V5DWUJ0y0QlBze0730SxTmhGO41nZlbrIy+hqRLhGTu60smw== X-MS-Exchange-CrossTenant-Network-Message-Id: 0230d382-53be-4096-3fbd-08d7c688b2a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2020 13:24:30.9440 (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: KsAE1V+tdpioSykguZvNDzkzTDNPjvt/QdoJOWuZtTHywpt24ylNkP7vIs/AhqX44P963Np6vufc3y+ykX+/+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR8401MB0930 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 12 URL's were 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_05:2020-03-11,2020-03-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 phishscore=0 impostorscore=0 clxscore=1011 priorityscore=1501 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003120072 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_539c8673786c9c5898ccab470b345740hpecom_" --_000_539c8673786c9c5898ccab470b345740hpecom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 change= s 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 ; Eri= c 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 provid= e. > See: https://www.mail-archive.com/edk2-devel@lists.01.org/msg11928.html > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2547 > > 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/M= deModulePkg/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, sizeo= f (EFI_GUID)); > > // > // Network device process > -- > 2.25.0 > > > > --_000_539c8673786c9c5898ccab470b345740hpecom_ Content-Type: text/html; charset="iso-8859-1" Content-ID: <15E6E7828CE8084F8E726142F4B748F3@hpe.onmicrosoft.com> Content-Transfer-Encoding: quoted-printable
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 change= s 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 &l= t;devel@edk2.groups.io> on behalf of Leif Lindholm <l= eif@nuviainc.com>
Sent: Thursday, March 12, 2020 11:55
To: devel@edk2.groups.io <devel@edk2.groups.io>; Schaefer, Daniel (DualStudy) <daniel.schaefer@hpe.com>
Cc: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; Chen, Gilbert <gilbert.chen@hpe.com>; Dandan Bi <dandan.bi@intel.com>; Eric Dong <eric.dong@intel.com>
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 pro= vide.
> See: https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__www.mail-2Darchive.= com_edk2-2Ddevel-40lists.01.org_msg11928.html&d=3DDwIBAg&c=3DC5b8zR= QO1miGmBeVZ2LFWg&r=3DwVtkBG7Yvxr1ZwGC2X-DFznM8iUD7og3137fRa2yRiU&m= =3DOH3BPEpUySzO08XGI-6pvl4Uo-7mUgOsaf-jKHSCoJM&s=3DpUtOxfKtpYxlYwtDHP8= hhRZ8QJ52whxSqi285877XsM&e=3D
>
> REF:https://bugzilla.tianocore.org/show_bug.cg= i?id=3D2547
>
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> Cc: Abner Chang <abner.chang@hpe.com>
> Cc: Gilbert Chen <gilbert.chen@hpe.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> ---
>
> Notes:
>     v2:
>       - Use CopyMem instead of CopyGuid= [Dandan]
>
>  MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 2 = 3;-
>  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/DeviceManag= er.c
> @@ -619,7 +619,7 @@ CreateDeviceManagerForm(
>          TokenHelp =3D H= iiSetString (HiiHandle, 0, String, NULL);
>          FreePool (Strin= g);

> -        FormSetGuid =3D ((EFI_IFR= _FORM_SET *)Ptr)->Guid;
> +        CopyMem (&FormSet= Guid, &((EFI_IFR_FORM_SET *) Ptr)->Guid, sizeof (EFI_GUID));

>          //
>          // Network devi= ce process
> --
> 2.25.0
>
>
>
>



--_000_539c8673786c9c5898ccab470b345740hpecom_--