From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.63]) by mx.groups.io with SMTP id smtpd.web08.7740.1664435450949750568 for ; Thu, 29 Sep 2022 00:10:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=eeFqZyLn; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.102.63, mailfrom: abdullateef.attar@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TIr3ny7iy/Lrfsv6ZffpgvtjW2HWP0tGRETuFKibqPXYt58gxY5whixkwwEY7HAcaSjNUFdDa/NBHzdh5OZq3Fi+mKceYocgdd/U2qHLNh+DQbqc3AmKlHxlrwLGKHHlEaIq+YSka4oCzuamFT4sUtBS67wk6yrXZHfD1XuqkLbvkOkyUAbrIAFe+tFmfn+eOdeF8xuoHCrlbVYhFlEF1TQ60SXlGLRL6TWNAmBXtJFZVTvY5c3s8NVnrVhBGIAsF6Ex0BsMpVYLTFTEBdbV0YjQWyrWvROlJK4AjZAao4QtNmN8ylB3354+E03cc/jcVwMQIuJmagW6BRqed45c+g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=U4DbG+MQMK8FdjZbwD1ZwPzGgoVV+0HeLU2ilfrznt0=; b=XslA8onT0bOI946RbzGpgEpcCN5c7cfW6wa32Np9RGOwYfVsuyIVMRaes3TZwlD0+jVHL9egRvGv4Ni4VDxttW3Yg0NhZJkC/5Lj7/+FkFxAT25MGElcTzGnzDupGPnbf9BuKgSYtz+e2ufPLoB8ZIxCZ3flnmIdBGWey76k5GGv+amuKigsrhIsqKM9XtOCRlXSxLA3Tpngmd+wLaWXGkhF31SdYVuljqBy9EqKgk7DTaEDq2nIDddONYMnbq+h3VMYR/uFqrTbyQYtyi5+0prd2ZKnaR+AcbXmgnKmQ59PAizjYMLbPaQxqkFMP3q4pDs8pxpH2LYynstEsw+o4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U4DbG+MQMK8FdjZbwD1ZwPzGgoVV+0HeLU2ilfrznt0=; b=eeFqZyLnVPBbaKC2AeulwPft9wt8qxovvf5jBKSoZm5fvQVaaiDkOad1EiVizbV0LkUPTo0z5lTR04hT6n2faApt2AKUhBWeZA3YZ+yZBM+qFQHN/nocZTwAi+/R2shKWNNRckH9YS5Bi0LrO+J9IZ8QCopc4ck08Q80SdIIHZI= Received: from IA1PR12MB6458.namprd12.prod.outlook.com (2603:10b6:208:3aa::22) by BY5PR12MB4227.namprd12.prod.outlook.com (2603:10b6:a03:206::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Thu, 29 Sep 2022 07:10:48 +0000 Received: from IA1PR12MB6458.namprd12.prod.outlook.com ([fe80::6170:9bdb:7130:57fe]) by IA1PR12MB6458.namprd12.prod.outlook.com ([fe80::6170:9bdb:7130:57fe%4]) with mapi id 15.20.5676.017; Thu, 29 Sep 2022 07:10:48 +0000 From: "Attar, AbdulLateef (Abdul Lateef)" To: "Chang, Abner" , Sunil V L , "devel@edk2.groups.io" , "ray.ni@intel.com" CC: "Kinney, Michael D" , lichao , "Kirkendall, Garrett" , "Grimes, Paul" , "He, Jiangang" , Leif Lindholm , Andrew Fish Subject: Re: [edk2-devel] The principles of EDK2 module reconstruction for archs Thread-Topic: [edk2-devel] The principles of EDK2 module reconstruction for archs Thread-Index: AdjPX4ZZG0rDXS4WTdOIWvoiYOLYcgC9rttQAC2dmIAADxJbkAAiVmtw Date: Thu, 29 Sep 2022 07:10:48 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-09-28T15:00:30Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=936c2003-c641-4521-b45f-7c76248bcf2d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA1PR12MB6458:EE_|BY5PR12MB4227:EE_ x-ms-office365-filtering-correlation-id: 3c437a14-058d-4979-8010-08daa1e9bc4f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LSXjNocbsF34FhYDlgjG1+m6cfCTwUlw+mMZDRlK/AgWf3936nOsZa+Jk5ffEk5qrdx580YOlaqHRhs8j5/2bEE+eXpVzvhS3I99lJoFeTDcnB4WUk7Ay307fyGXv4+vdjsZzRY6MZYwsCQ/kNH7aVqW5oWi0VMpyMsfGA6fgZ679NHv0xH6TDKRPCldZOMhTgEuBeS3ykOOH4jl2BsBu2Ep21TsAGCHUeJpTBzkXfUMb1DHmtReJYIkWgMF46yvHhsthJxsNoguEJiD6FCjL7WGnJM9Zk12X+TUKp6vkU7LBudSAVcctmtda6mH+DhwRcyfve5naeSnYIVcrZE7OAe3iDW0MPu1JHmzc/dLS2+gBlzjny6ub63EsZUhVlKH5NAxNMjhKsbjnfzxue5OKa9nlpNFMK/x5mkfTjPS4QHS37vWE/Q7FQPKLbPl/CIGE7xUNOM7dmmyxg1E/X66dCER08aH66o9EoCRMR09V+/zTdAMmtpM0oK7mredx2/nQEo/iBCHqTzgV+cDiuI52KmQsfuhm2reNxONxrQh5HRIgDMeuxQnixdH97MjN9d0qBZBVZbpgH23OidQvSnAkGAIMtoEikcYapNErVnvjNmcL9qS5+v6qeHUlQtxpWcNKo5ucT9Uyi5cF0b6LapU9QvINUjHLR5vebZeQSVtt2AcrXjAJJTfl3Y+SQdt0GFA+9lTHzKy5iqV2uTDH5bCHZM/Gm90hskchUK/+pSAcTdo9qC4E3bad8FesPIt1UTkIF1tyh1P4WuZEjz9koFDc+cF38OnMcN9RH1Ql8Bs7u9Cqw5XSgO9kH7xcFC+ckcpOorlsB19exouaGBtkDWSPA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR12MB6458.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(376002)(366004)(346002)(396003)(451199015)(66476007)(26005)(9686003)(186003)(54906003)(478600001)(7696005)(6506007)(38100700002)(316002)(38070700005)(33656002)(2906002)(966005)(53546011)(71200400001)(66446008)(83380400001)(8936002)(52536014)(110136005)(122000001)(5660300002)(66556008)(4326008)(8676002)(66946007)(76116006)(64756008)(45080400002)(55016003)(41300700001)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?VeU/PCE316TcFht3TC2GFdt2ToIjNXwv6XVCJtbff0bz8DhHywLBpNP+g6NN?= =?us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ifoa+36JXxRqRG1HjQzSZJVhgCvHqGWkgHgrTS?= =?us-ascii?Q?YD+YYut5MlOFpTQ7k/K+lkYvRrjRWt3tSxjZkHsOT+AfqLWdZ6yC/3/xb1yx?= =?us-ascii?Q?5NfdGzOE9mFnnkg8UhiEdYtbbB+deSGlOZk18tU7fx1XhXeLQc56ehJkvl21?= =?us-ascii?Q?6M8CjUlkvsIET11lslDkd+qDnK7i72RiSFqZI3RcclTAmGL8W8WPOyL75mVM?= =?us-ascii?Q?Nsawoi721AEhxp2IiURzEtb88BAKLZXnWTayHi9ppGrxcpIF4jClY1xWQnaD?= =?us-ascii?Q?Xj+zH2lGpFyjPGaz/Em1ryj/3QYvrxv+DyQL1d7NsyxD28ycrFcHJWUsgIDx?= =?us-ascii?Q?F/6n/TLw5+IhJ1YSvPSaMdHED8F6KnR53gKuXc27s9L504uyKQ7551stwvn3?= =?us-ascii?Q?FWozT3cKvYfIvsBec3AjLo5Z23/mZEIUW/0rpWSKaAiQaiwI4Uepzgpl5FKk?= =?us-ascii?Q?7DYk1Y5380RXJ20yL2+exTKsuwtM4nTGfpBCn+UDqvcpiFVryDa3TWAoztxP?= =?us-ascii?Q?yRXhj13bOU7tgteL9Hjlq5mokkAHbbwHCXFul44pUWQzuQZjCjqPzoBBK71m?= =?us-ascii?Q?bz3TLAhKWbJR/ljFLD7kiwbTq1a/9zJTPNJ756zihEnR9b1OthJx8Tj1PcjB?= =?us-ascii?Q?u8OrH+r2XHIQkUNkkOiwGChoFyqkif1dKlzNfviI?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6458.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c437a14-058d-4979-8010-08daa1e9bc4f X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2022 07:10:48.4812 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OrHBjobMcFIHzbIfptG9EvHg1XHooHvtB1HorbfY4LHduCq3MvDiMbJNnsjL/s9TU1fuCVC+fic5dgOhr/bR8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4227 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Abner, Looks good to me. Reviewed-by: Abdul Lateef Attar Thanks AbduL -----Original Message----- From: Chang, Abner =20 Sent: 28 September 2022 20:31 To: Sunil V L ; devel@edk2.groups.io; ray.ni@inte= l.com Cc: Kinney, Michael D ; lichao ; Kirkendall, Garrett ; Grimes, Paul ; He, Jiangang ; Attar, AbdulLateef (Ab= dul Lateef) ; Leif Lindholm ; Andrew Fish Subject: RE: [edk2-devel] The principles of EDK2 module reconstruction for = archs [AMD Official Use Only - General] I just had created PR to update edkII C coding standard spec for the file a= nd directory naming. We can review and confirm this update first and then g= o back to the principles of EDK2 module reconstruction for archs. Here is the PR: https://github.com/tianocore-docs/edk2-CCodingStandardsSpecification/pull/2 The naming rule is mainly for the new module or new file IMO. Some existing= module may not meet the guidelines mentioned in this spec. Thus we need th= e principles of EDK2 module reconstruction on the existing module to suppor= t other processor archs and not impacting the existing platforms (e.g. rena= me the INF file or directory to meet the guidelines). Sunil, seems RISC-V CpuDxe meet the guideline. Please check it. Just feel that having CpuDxe.c to Riscv64 folder is not quite a best solut= ion. I think at least we can abstract the protocol structure and protocol i= nstallation under CpuDxe\ and have the arch implementation under arch folde= r. We can discuss this later after we confirming the guideline and principl= es. Thanks Abner > -----Original Message----- > From: Sunil V L > Sent: Wednesday, September 28, 2022 3:34 PM > To: devel@edk2.groups.io; ray.ni@intel.com > Cc: Chang, Abner ; Kinney, Michael D=20 > ; lichao ; Kirkendall,=20 > Garrett ; Grimes, Paul=20 > ; He, Jiangang ; Attar,=20 > AbdulLateef (Abdul Lateef) ; Leif Lindholm=20 > ; Andrew Fish > Subject: Re: [edk2-devel] The principles of EDK2 module reconstruction=20 > for archs >=20 > Caution: This message originated from an External Source. Use proper=20 > caution when opening attachments, clicking links, or responding. >=20 >=20 > On Wed, Sep 28, 2022 at 03:33:45AM +0000, Ni, Ray wrote: > Hi Ray, > > > > 1. When a new arch's implementation is introduced to the existing > module which was developed for the specific arch: > > > > 1. The folder reconstruction: > > > > * Create arch folder for the existing arch implementation > > [Ray] Do you move existing arch implementation to that arch folder?=20 > > It will > break existing platforms a lot. > > > > * Create the arch folder for the new introduced arch > > [Ray] I agree. But if we don't create arch folder for existing arch > implementation, the pkg layout will be a mess. > > > > [Ray] Hard for me to understand all the principles here. Maybe we=20 > > review > existing code including to-be-upstreamed code and decide how to go. > > >=20 > Could you please take a look below changes which is trying to add=20 > RISC-V support for CpuDxe? > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgith > ub.com%2Ftianocore%2Fedk2- > staging%2Fcommit%2Fbba1a11be47dd091734e185afbed73ea75708749& > data=3D05%7C01%7Cabner.chang%40amd.com%7Ca419e6a010d34fde464b08d > aa123e080%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63799947 > 2732494527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIj > oiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sd > ata=3DVq6pJLnn8yJrJhFZn7LfLbZzrtpG4n1VLWgAil6J38U%3D&reserved=3D0 > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgith > ub.com%2Ftianocore%2Fedk2- > staging%2Fcommit%2F7fccf92a97a6d0618a20f10622220e78b3687906&da > ta=3D05%7C01%7Cabner.chang%40amd.com%7Ca419e6a010d34fde464b08daa1 > 23e080%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C63799947273 > 2494527%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV > 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata > =3DxFmvUv58vh4AUAM17Qy9G5jZWFZlK2Ozt3njpG1e8%2BY%3D&reserv > ed=3D0 >=20 > What do you suggest with above example? >=20 > 1) Common INF for all architectures - but modify INF alone, no X86=20 > folder creation. >=20 > This is what I have done in the commit above. May be of least impact=20 > to existing code since it is only INF change. But like you mentioned=20 > this is bit weird that X86 files will remain in root folder directly=20 > along with some common files. >=20 > 2) Common INF (CpuDxe.inf) + create arch folders X86, X64, IA32,=20 > RiscV64 etc >=20 > IMO, this is probably the best approach. What would be the challenges=20 > with this? >=20 > 3) Separate INF for arch like CpuDxe.inf for x86, CpuDxeRiscV64.inf for R= ISC-V. >=20 > This again probably is not a good idea. >=20 > 4) If the module/library is specific to one arch (ex: SMM(X86),=20 > SBI(RISC-V)), then create separate INF. >=20 > Thanks! > Sunil