From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.85]) by mx.groups.io with SMTP id smtpd.web11.30310.1665931287695060875 for ; Sun, 16 Oct 2022 07:41:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=OOn5buQX; 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.244.85, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qsu4UkdvSZ4ehZ84ZTKH0g2Zq3Qo5vQDwSZ/cYAvKan+bsrk15uKP03QmnjnT2KvkgB7R5qKS97kcnyvMboxdLrWnTDRl5KKj8W+WWksw/ThRwnUB17SPLA9+3ub5noeZuLWXRo5HECbO+9XrCctc1BKUwLD2ROH0eLtI0LdSNiuU8sskXJW0b9RD+QryFP8hPDHpv4lZtYPdfVXvVI4eYE7kH4eTblE4F7baa9Ni+/iXS5h2q8k5L9b5eQPj31bt+O151RKHOLhjJ5bo8KstUMBYr4jndN7ZDRtJN3rE6ZuEzQ1TfzE1rjiT2TjIni8I/KWqVF7u3+SnVm0OTuIeA== 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=W/C2llntfM7jVPlyUQVwD32TWfOuToMXq0qzgmupJH0=; b=UHxSLjX1WKxJ5qu5mSPpkZuZm80TrY9lzuIUIq3dFceu/MATsHWIV75PeK4PXMA/f+fgRrtFVnV2PveAY+tMv0K/xgoLOXC/5tgIUbr4iY6/aB7FoRnTmaAbCe4lqZb0FLvLCeqnlZOB/0/+pPxJ5OT4lQ/QMKznmruyU59EHkd4blU9bVnA9tYofo1CIfyv9fELztQnAbLOXQT/Vh7jzpQyLQP5k+ip9sJEALaVHgLiK/5vHtrFao2jMckaGp0wV0XeMx2y5i+RrezXVyvEvX+6quPHqM1kRln9zKY0YLwyEDOZueDiqXLw6KZLCFYAgMZIUhqBuw3rVcCayFNRWA== 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=W/C2llntfM7jVPlyUQVwD32TWfOuToMXq0qzgmupJH0=; b=OOn5buQXUAQpmdw2PgSY2475tWXlx6uVqcONqL/ENt++n0ButSPlv2CEJeqPYshRdhMTwc1sn7DxfOV4nCb70A0N7XLIX4cmE5p4a/5sKIXok+MMjYcw1Rs7jPDVwxNZQkISwqglaM9Jyh966sLKUuy9tCcKlKlzAvYxZWQqZ40= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by IA1PR12MB7616.namprd12.prod.outlook.com (2603:10b6:208:427::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Sun, 16 Oct 2022 14:41:24 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::2eab:b851:827c:1d88]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::2eab:b851:827c:1d88%3]) with mapi id 15.20.5723.032; Sun, 16 Oct 2022 14:41:24 +0000 From: "Chang, Abner" To: "devel@edk2.groups.io" , "sunilvl@ventanamicro.com" CC: Eric Dong , Ray Ni , Rahul Kumar Subject: Re: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 17/34] UefiCpuPkg/CpuDxe: Refactor to allow other architectures Thread-Topic: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 17/34] UefiCpuPkg/CpuDxe: Refactor to allow other architectures Thread-Index: AQHY3+0pI7eLvJCYxU6xAsx1aG8mBK4RF27A Date: Sun, 16 Oct 2022 14:41:24 +0000 Message-ID: References: <20221014164836.1513036-1-sunilvl@ventanamicro.com> <20221014164836.1513036-18-sunilvl@ventanamicro.com> In-Reply-To: <20221014164836.1513036-18-sunilvl@ventanamicro.com> Accept-Language: zh-CN, 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-10-16T14:41:21Z; 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=b635c54c-92b8-4e10-abcb-b8c96930e8ff; 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: MN2PR12MB3966:EE_|IA1PR12MB7616:EE_ x-ms-office365-filtering-correlation-id: c963a936-702d-4c16-2912-08daaf848020 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LqJS/W+ppIdOb3g+4zTRVtDhOxA30KwZFYLIcXyoBzQ6BF7ZpVttfnYhsUBiuez/gjvul406BljhKMUzVfLyxjFV18DMNIWc5AoDsFJkBvlUG2aelae9/HB0MVMlq7ZgMu6l9/gbrVHzbiTKcJO4a/Nf5yu/SRcBNENI0FQzO/pEVVmZ+PuRQI/QM70RAY6g3+FAE9rCKInMs5E/SKXf9uivvf8RFbZo/E329DKmA7fWP3FFeYzVh0n+2OjoGK6gzPScu7Vwkv8ODHUpE4oyz57DAr7aVbzdCw8VpWFpgxbMB+tR1HZYxMkdL/39igupx+EwTpI8OD2zTLh1p6DZtAQDPcHyg0sol+8EPsOJdY3d5uTmaTrBzYTghwKoYCYrcevDvg1DHYnbviRPi4NaBqmxDsF/x75PnqMpjMUsdWDlRRLuz+pBcXwhmLz0TRIlqIUTyhziYnVyS/XuCeUOKKTuKoOxXnQY6MS4Jt6OJkWYEsAQpSRF/tDkesyFi867Tum3VpQYSq23B2SMAZkoB68fgh64OwgjBJl+sQSBf4hS1HioVGrijCtpQrV/3h1ZhiibwDsvp390P7z/N65NmkFPOCZI8iG/JbTq4YFJIZjUf8NuDbbTpdm9TEBE60IbD2T6g2yLwrwwzV5P+cYLFL/IPTrqMF1rPf2Kk815/6Fv6clkaEogFgn2QkAGMzrMsxT1u3qW6ifuW36GNoZFJ2LBYoxlew8RiVtyWErmcLLXd7rnvZ7RMaCEiNmyABkriVk6gK1xrx2NTTmwRqHg3TZzCkv5vkPKzERuQGyuK4BEkoptcGR7p6EPZOoRep3SX3b8yTZvjL4ukLORP1Xzhw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(39860400002)(366004)(396003)(346002)(376002)(451199015)(38070700005)(86362001)(55016003)(33656002)(9686003)(41300700001)(53546011)(26005)(4326008)(8676002)(64756008)(66446008)(7696005)(6506007)(5660300002)(52536014)(66476007)(8936002)(66556008)(45080400002)(966005)(71200400001)(478600001)(66946007)(110136005)(76116006)(54906003)(19627235002)(316002)(38100700002)(122000001)(186003)(2906002)(83380400001)(66899015);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-ant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Y637ZakQTudKXnWlanj5d32U5219ILrIsxTTjZQGRi?= =?us-ascii?Q?WMvFPkK63AKV19wDxMeOfQbMKtMm9SXwK+EIyYHtOAU6ayJfgbdT7xTUGL3q?= =?us-ascii?Q?R64oxfNZSq65gfp/O+3u+qiVubV51hGKNUsp7M1KKTVJfNNE79vnNEJExOD8?= =?us-ascii?Q?gSJo1fH3+mPFvlEYR/KlHskD0/NuKkbN0Y9gFwRiibD5EhqcAKwHGQfKGk51?= =?us-ascii?Q?YGOUOTIdw5QC8eDkRIYMVLu4EnnJvaaN8qYVIXDuramNTmMtWQsqLCUrd98T?= =?us-ascii?Q?Rajcgkii/RiKaFtaYmy8+iPn9inpY061TjV9IkFsTMbJQm8AQqliCLF0POeq?= =?us-ascii?Q?LJ/GN021vxHp9mUiUCabTflPeTo0LfWgSKRz30SjZB1SmnYg5OKogH61HT+h?= =?us-ascii?Q?+QbpX9JyZ+bq7zRpQkNz+349f75oJdaYwvwF1Fp3qPSSrKKrWDFUF2LScNzK?= =?us-ascii?Q?K48yxUdQ6U0EDPx+XfvqhCmDCbljPH+Q2aJorqrtQOS8jGh5guT98n2wuTYp?= =?us-ascii?Q?hKLeizVLQSWXWMxrdTwiA+/4MmdAN2J7lim234cJHLK3KvUiQzqN/02et3NM?= =?us-ascii?Q?6Bs11IQAibME7hFr78qWgS0GwuWS3/4qa0EuyyC8wnH2zHqTN5tYE+a9+yNH?= =?us-ascii?Q?q6l41V/e0bHIwbhH3ItRzRpwl1fAX/Mo+WzvPYWSVGxLcEaVUJyWhLEmQeid?= =?us-ascii?Q?LAflDlIdEjjDHwsgD/eqsNdeC5dr9gxB58/K77c0?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c963a936-702d-4c16-2912-08daaf848020 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2022 14:41:24.6169 (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: V7ubp0zI53cCNqdKSWN7brzBsuQeHEB1d+dlvF03P3xViJZa21djxFzmQ+sXY7oyTsZvE/KNEL8t+n+mCvZZHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7616 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sunil V L > via groups.io > Sent: Saturday, October 15, 2022 12:48 AM > To: devel@edk2.groups.io > Cc: Eric Dong ; Ray Ni ; Rahul > Kumar > Subject: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V4 17/34] > UefiCpuPkg/CpuDxe: Refactor to allow other architectures >=20 > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. >=20 >=20 > REF: > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugz > illa.tianocore.org%2Fshow_bug.cgi%3Fid%3D4076&data=3D05%7C01%7Ca > bner.chang%40amd.com%7C41895629d015414ff9bd08daae044add%7C3dd89 > 61fe4884e608e11a82d994e183d%7C0%7C0%7C638013630708017518%7CUnkn > own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik > 1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DaO5v%2Fc7HtU > h9CkdqJniJ6tIMS4cV3RX48EiCRhN%2F3pY%3D&reserved=3D0 >=20 > Currently, CpuDxe supports only X86 architecture. To add support for othe= r > architectures like RISC-V, this need to be refactored. >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Rahul Kumar > Signed-off-by: Sunil V L > --- > UefiCpuPkg/CpuDxe/CpuDxe.inf | 28 +++++++++++--------- > UefiCpuPkg/CpuDxe/{ =3D> Ia32X64}/CpuDxe.h | 0 > UefiCpuPkg/CpuDxe/{ =3D> Ia32X64}/CpuGdt.h | 0 > UefiCpuPkg/CpuDxe/{ =3D> Ia32X64}/CpuMp.h | 0 > UefiCpuPkg/CpuDxe/{ =3D> Ia32X64}/CpuPageTable.h | 0 > UefiCpuPkg/CpuDxe/{ =3D> Ia32X64}/CpuDxe.c | 0 > UefiCpuPkg/CpuDxe/{ =3D> Ia32X64}/CpuGdt.c | 0 > UefiCpuPkg/CpuDxe/{ =3D> Ia32X64}/CpuMp.c | 0 > UefiCpuPkg/CpuDxe/{ =3D> Ia32X64}/CpuPageTable.c | 0 > 9 files changed, 15 insertions(+), 13 deletions(-) >=20 > diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf > b/UefiCpuPkg/CpuDxe/CpuDxe.inf index 235241899222..65961813f74b > 100644 > --- a/UefiCpuPkg/CpuDxe/CpuDxe.inf > +++ b/UefiCpuPkg/CpuDxe/CpuDxe.inf > @@ -29,28 +29,30 @@ [LibraryClasses] > DebugLib > DxeServicesTableLib > MemoryAllocationLib > - MtrrLib > UefiBootServicesTableLib > UefiDriverEntryPoint > - LocalApicLib > - UefiCpuLib > UefiLib > CpuExceptionHandlerLib > HobLib > ReportStatusCodeLib > - MpInitLib > TimerLib > PeCoffGetEntryPointLib >=20 > -[Sources] > - CpuDxe.c > - CpuDxe.h > - CpuGdt.c > - CpuGdt.h > - CpuMp.c > - CpuMp.h > - CpuPageTable.h > - CpuPageTable.c > +[LibraryClasses.IA32, LibraryClasses.X64] > + LocalApicLib > + MpInitLib > + MtrrLib > + UefiCpuLib I think we also need to refactor UefiCpuLib and MpInitLib when other archs = have their own implementations. This patch needs maintainer's review. However, same comment as I gave earli= er. We will have to wait until the File Naming and Directory naming section= s are firmed and published in edk2 coding standard spec. Abner > + > +[Sources.IA32, Sources.X64] > + Ia32X64/CpuDxe.c > + Ia32X64/CpuDxe.h > + Ia32X64/CpuGdt.c > + Ia32X64/CpuGdt.h > + Ia32X64/CpuMp.c > + Ia32X64/CpuMp.h > + Ia32X64/CpuPageTable.h > + Ia32X64/CpuPageTable.c >=20 > [Sources.IA32] > Ia32/CpuAsm.nasm > diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h > b/UefiCpuPkg/CpuDxe/Ia32X64/CpuDxe.h > similarity index 100% > rename from UefiCpuPkg/CpuDxe/CpuDxe.h > rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuDxe.h > diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.h > b/UefiCpuPkg/CpuDxe/Ia32X64/CpuGdt.h > similarity index 100% > rename from UefiCpuPkg/CpuDxe/CpuGdt.h > rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuGdt.h > diff --git a/UefiCpuPkg/CpuDxe/CpuMp.h > b/UefiCpuPkg/CpuDxe/Ia32X64/CpuMp.h > similarity index 100% > rename from UefiCpuPkg/CpuDxe/CpuMp.h > rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuMp.h diff --git > a/UefiCpuPkg/CpuDxe/CpuPageTable.h > b/UefiCpuPkg/CpuDxe/Ia32X64/CpuPageTable.h > similarity index 100% > rename from UefiCpuPkg/CpuDxe/CpuPageTable.h rename to > UefiCpuPkg/CpuDxe/Ia32X64/CpuPageTable.h > diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c > b/UefiCpuPkg/CpuDxe/Ia32X64/CpuDxe.c > similarity index 100% > rename from UefiCpuPkg/CpuDxe/CpuDxe.c > rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuDxe.c > diff --git a/UefiCpuPkg/CpuDxe/CpuGdt.c > b/UefiCpuPkg/CpuDxe/Ia32X64/CpuGdt.c > similarity index 100% > rename from UefiCpuPkg/CpuDxe/CpuGdt.c > rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuGdt.c > diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c > b/UefiCpuPkg/CpuDxe/Ia32X64/CpuMp.c > similarity index 100% > rename from UefiCpuPkg/CpuDxe/CpuMp.c > rename to UefiCpuPkg/CpuDxe/Ia32X64/CpuMp.c diff --git > a/UefiCpuPkg/CpuDxe/CpuPageTable.c > b/UefiCpuPkg/CpuDxe/Ia32X64/CpuPageTable.c > similarity index 100% > rename from UefiCpuPkg/CpuDxe/CpuPageTable.c rename to > UefiCpuPkg/CpuDxe/Ia32X64/CpuPageTable.c > -- > 2.38.0 >=20 >=20 >=20 >=20 >=20