From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 57741AC0DF1 for ; Fri, 1 Dec 2023 08:40:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=MQKQBK/gWgyEfg4bUkEO6AEGmu4CEVa1wFTfodDkJFA=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1701420002; v=1; b=IWlq5G5O1/9mjb+e3ywWZQQMiptGm7eByi1dv4YYoJWuE5SR37F9OfWK4B2keoQCFBpi30UW iWDNEYoHNtEwzSwy5n0bnVBR9159HgnkyF1KsX+45TJTAkcMzGMKDl0ueks6glyf9UqzIniSCWJ wNYgAP+fELLaCjkM78vlByM8= X-Received: by 127.0.0.2 with SMTP id q45iYY7687511xXwo1I4aMrw; Fri, 01 Dec 2023 00:40:02 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.18625.1701420001579659718 for ; Fri, 01 Dec 2023 00:40:02 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="393197801" X-IronPort-AV: E=Sophos;i="6.04,241,1695711600"; d="scan'208";a="393197801" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2023 00:39:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="719425746" X-IronPort-AV: E=Sophos;i="6.04,241,1695711600"; d="scan'208";a="719425746" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Dec 2023 00:39:55 -0800 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 1 Dec 2023 00:39:54 -0800 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 1 Dec 2023 00:39:54 -0800 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Fri, 1 Dec 2023 00:39:54 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Fri, 1 Dec 2023 00:39:54 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nYgPqQBZ01aiBbWo9nRdZp6UHHuK//c5u3cCPGzPVvn+7HWJLg8PqSkQ7SMgjJTxM38c2hneOvUoCRF5OWp2a538INblZqzZqXRf7s+WgZuniXc2gvEG0tZR8D0zavVWXYh3/4IZGnThK6ry0TXRYfwU9pgHcXKV4hoRKAfO6sLzMUQvftxok5ayw02qLXJNoqKmrtqJa6zsthabmYrytWfwPLrvl3bwl0zL9bqbwjdO4Tl5esJNs37kV73+f1i67+on5UvZ47TT0SjfHc0T+zsR3Th64TixzQBy4KTZ6JJxFRDoZaf1Kd+IYClGr5grtpSCXy7fopxxhaG0cDGgpQ== 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=vpWEFfEMDjn+BArnGfARQxhZ+8VX+UvaZLWxYp9OEbA=; b=aDd/z8V4QuV+DtJNbOmXNTVsQ9kLjgn0U1vP6WwequraF4ZrgnE4T09ROW8pEsKtvh3Av0K25ujihBeB4zbqHFsx+RPRZEp2V5xUMjrrNEr97+LOgzW0vKqng6PwRy+Pmm3FFScN9M+SjkRWrP5Ya7n/Ewde5p7HrO7UgVSmAqZ5aoDQ9JsnnbJ7rtmXENWBl4gJpq0Nvg1BNecDofDjpthLoNlUCR2dFUvVaLNC3A9ARyLCPKV13REpwWUqEZwnmGfdsWjfzzagBeVrCeV1kPs/8GmJx3oFPQqojDTKK8+wtzqkN80fzxu2vhb6mmx1EBYHirE60a/Aco3P0SptKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by SJ0PR11MB5086.namprd11.prod.outlook.com (2603:10b6:a03:2d1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24; Fri, 1 Dec 2023 08:39:52 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::b614:1f5e:8b0c:9858]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::b614:1f5e:8b0c:9858%4]) with mapi id 15.20.7046.027; Fri, 1 Dec 2023 08:39:52 +0000 From: "Ni, Ray" To: "S, Ashraf Ali" , "devel@edk2.groups.io" CC: "Kumar, Rahul R" , "West, Catharine" , "V, Sangeetha" Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/ResetVector: Option for 1G Page Table Size increase Thread-Topic: [PATCH] UefiCpuPkg/ResetVector: Option for 1G Page Table Size increase Thread-Index: AQHaI7OgEKnsy20hXk2oSRen+kjucbCT5n2AgAAQowCAACSrIA== Date: Fri, 1 Dec 2023 08:39:51 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|SJ0PR11MB5086:EE_ x-ms-office365-filtering-correlation-id: 15d6fab5-000b-4d06-31e2-08dbf2491615 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: E0ytsXhl62v7ub22gWVVaoVJukem2sM7Az0ix1lHoSYUYeZttXF/hXGgYmQRnuI5ELf9kfgnd/M7bibLBubEbyBcKzEndKYgJsc3TZz8hNYK+4Yor00p7Q8eQ02kuhjIECPBsVsicrXrujFohhtFPjuIVmyLHS5dmXmbsAFyIoHaMPzvWVQ7r+no8WuUqplDNU/y9eQvsEnbEPW2dKipa7EubJZqYodIAPEKHlnx2z5uzHf86cQB/hPnAFaSkkBKFd/gQN6JlCGJNUCDJWrBgeYwgjBUrDIDo8ZRKBG1oSfxJ3XToLVlCyeW+SUNltaug8OCz6dlHzJQAIPpBKKRg+dd4SPXZVuDHpayzw1uib39yZE28rtJn46e52iqr8b32/PobPkHp3UsCFuQ0WWqDeKsBpwzHQWterR4MTnqzy9X6tFkKjj3y9C+5+F570xhdPx2lRKtGo/XDBilpa7V40QJjNNqYYPVt/ZI8/0piAlHEBcIg7ylkNZ4QM5OP3MszATsMsiDN4jGsJYp1YVheNKHYRn6/YiWHIt0uzmuvkPDOCQIXc7oh7mB4km3In+522q/+EDiYeQ0CucFiwKtVT4J7fqY6sYVNhM43ijw8YWeG5LejhAiGF+XJMzkj1H7 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9IrtDDR8+Fe3exVhMuZ2PKMf3atnp063AlAe1axndOkRwd6eqni3AnbFksvh?= =?us-ascii?Q?myKH+IrHLCAlf1BwhyWorrjIvtD7qS1FwOOpeAaRVvWx5a/6QMYhbjxjTt9q?= =?us-ascii?Q?OzDnTPX+z4BGp9EYhFbFS7lgarx1LrtikTHt3EP+ymXmihuAXyzCbKiZFsyF?= =?us-ascii?Q?zNDqIdABBGMjeLNjv9D/WeH7NvbwSBzUF/6E/uA+EHeU8w1iaPV07AFbiHDF?= =?us-ascii?Q?vhZvpdPhmXSr84h1HmJdyApjV07R8Vm3TUKVY+R9tYjwal/W8JQTNMi6sfQm?= =?us-ascii?Q?Qt0HwRFAwmq+Td4VV6TjwkWu31xShwwSizUueTFYG3GWRkJxkMRG7jqEeSV+?= =?us-ascii?Q?Vdw1XzJsaFQB21yowGsaBDNIxl9iywAt/PSW3a+a0KpcE6tzmYtUAwrV0E4M?= =?us-ascii?Q?wGqjbahXAWqNXvg30elByaWEryZJQu9094efzVYiK4dpy1d/j3FU0oNcvaNh?= =?us-ascii?Q?EQJFaHPbqUNxdzig3xkbl4e51Z7m8Rb9j0DNk5cjwSKwvPUqCmpRDwA5P3dZ?= =?us-ascii?Q?Qr5HgjPGnuEmOrqRpk0AuyUjyH0bbUB9DfbDXiI3oMTcaREWydC8ia4uYt9+?= =?us-ascii?Q?AahChwkGV7xGmeDt2dEICkVEepSXVpcuXcnYnsCFvzuE1b1uxNDD2Jz4UZy6?= =?us-ascii?Q?KiH4ixxEmCmFKrOywGEueuJu7PnAYSmJip8s8Ur8fvxc1PXCHPI056/aziTA?= =?us-ascii?Q?eSWMfMrJ53btYOG2sVWbOqaZIqFcwA+F6mirYS+Wb2vKb7Mo1V6i96JJLwCD?= =?us-ascii?Q?NZm7l9VJF6+Re6itaARqwGYTRU/4hYcZlWmoCaKVyKhfiSIvrKKIPNA2H/D8?= =?us-ascii?Q?ybf9oMc1PF54pxEpmver0JMCmfdmAkUAqg9vB8ECGQdwbBvwIC284/gSrqlB?= =?us-ascii?Q?TUnJQ4U07evjNeQcPtZ/FU8twjyziN16Pg+2oajEWdzgn+j+cJIZG5yrU1tk?= =?us-ascii?Q?u4n1+uh6ZYkq3xWQchhQ8qVkKTzHwsP4swJutIylbVAxXoL4ZLNQMCQWavUe?= =?us-ascii?Q?HFYzl1do7JSoJKV69a+XnZwRky7wWx5QtClmeogtwg5ji4ppoyUEFs29qV49?= =?us-ascii?Q?srzrg1sF1/8WgbEWDzvo8gehvA8Z4HBjBWJ9GmYO9Uh/7M4MmoM5B3MX6GCZ?= =?us-ascii?Q?Y9HjjQYTTDUCUaGVRXoOxKIbtkXs8bvbpftcuFLEu+nWx9lLvK8hpMB8FqzH?= =?us-ascii?Q?+rjQFpupmJkBBQx7YM0AL4rvgSVgzl3zLguQVMlj7ycrDsT8SBq9ZClOkh62?= =?us-ascii?Q?O46YB9rcsUz5qYLE5pa3xfkM7u9218auozHYBxnkLfJuT9Ujrt+mpvKoUJDA?= =?us-ascii?Q?mgSLvRzoO8NuB8W7Vf6D+WTe/hsxUkFqCtW3shv8FcVkPmpwegZowRg0lLGz?= =?us-ascii?Q?NOqw0+7ntZkXno1QN2stwzbrFSFOdIOuaY9qpFfjkKIthXOPx+PHqTdlk/nY?= =?us-ascii?Q?H8EITSlUPtMRU3hpqL5GhoKFMtQlleCuDswBiYZNyq/21QIBxf96Jfd2qgpr?= =?us-ascii?Q?nyig6nUS0Z5GU0gV66dFEJqr9MnQTQgBaXBHwDVx8x34CuXzkqXfplc7J80c?= =?us-ascii?Q?xJPne5pSMgVv8vIyG5U=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15d6fab5-000b-4d06-31e2-08dbf2491615 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2023 08:39:51.9744 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lENOJUdwbEZI0jF9fQ5tkj+MrITgWM3OI2lZGelFXyGPsMQYqkq80IJq/OemNtNmPQAL9V+IneKd53IR/6ewug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5086 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: QLj3clGKPDNuxvrZnxSaWykWx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=IWlq5G5O; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Ashraf, If any code wants to map above 512GB, that code can create a new mapping in= memory or temporary ram. I agree your patch adds flexibility to reset vector. But I just do not want= the flexibility hurts the maintainability. Thanks, Ray > -----Original Message----- > From: S, Ashraf Ali > Sent: Friday, December 1, 2023 2:26 PM > To: Ni, Ray ; devel@edk2.groups.io > Cc: Kumar, Rahul R ; West, Catharine > ; V, Sangeetha > Subject: RE: [PATCH] UefiCpuPkg/ResetVector: Option for 1G Page Table Siz= e > increase >=20 > Hi., Ray >=20 > Yes, I agree. But if any device which needs to map above 512GB in Pre > Memory (Early PreMem). >=20 > if any device mapped any device below 512GB. And if the DRAM has 512GB > then it would create a conflict. >=20 > So we are not changing the default page table size, keeping 512GB only. S= o > that it will give room to decide the reset vector size based on the platf= orm > needs. >=20 > Sizes mentioned below: > 512GB - 16KB > 1TB - 20KB > 2TB - 28KB >=20 > Thanks., > S, Ashraf Ali >=20 > -----Original Message----- > From: Ni, Ray > Sent: Friday, December 1, 2023 10:58 AM > To: S, Ashraf Ali ; devel@edk2.groups.io > Cc: Kumar, Rahul R ; West, Catharine > ; V, Sangeetha > Subject: RE: [PATCH] UefiCpuPkg/ResetVector: Option for 1G Page Table Siz= e > increase >=20 > Ashraf, > When we implement the reset vector, we assume that 512GB page table > occupies minimal flash size and also sufficient for XIP code. > Any code that wants more page table coverage should create a new page > table, either in the temporary ram (when physical mem is not ready) or in > physical ram. >=20 > Why does this patch increase the default 512 GB coverage? >=20 > Thanks, > Ray > > -----Original Message----- > > From: S, Ashraf Ali > > Sent: Friday, December 1, 2023 1:35 AM > > To: devel@edk2.groups.io > > Cc: S, Ashraf Ali ; Kumar, Rahul R > > ; Ni, Ray ; West, Catharine > > ; V, Sangeetha > > Subject: [PATCH] UefiCpuPkg/ResetVector: Option for 1G Page Table Size > > increase > > > > Currently 1G Page table is restricted 512GB. this patch can help to > > increase the page table size based on the input. default will be 512GB > > build option PAGE_TABLE_1G_SIZE is used to increase the page table > > size > > > > Cc: Rahul Kumar > > Cc: Ray Ni > > Cc: Catharine West > > Cc: V Sangeetha > > Signed-off-by: Ashraf Ali S > > --- > > UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt | 4 ++-- > > UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf | 2 ++ > > UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm | 13 +++++++++++-- > > 3 files changed, 15 insertions(+), 4 deletions(-) > > > > diff --git a/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt > > b/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt > > index 4fcb15c3b1..4d153fc1a7 100644 > > --- a/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt > > +++ b/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt > > @@ -1,10 +1,10 @@ > > > > =3D=3D=3D HOW TO USE VTF0 =3D=3D=3D > > Add this line to your DSC [Components.IA32] or [Components.X64] sectio= n: > > - UefiCpuPkg/ResetVector/Vtf0/ResetVector.inf > > + UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf > > > > Add this line to your FDF FV section: > > - INF RuleOverride=3DRESET_VECTOR > > UefiCpuPkg/ResetVector/Vtf0/ResetVector.inf > > + INF RuleOverride=3DRESET_VECTOR UefiCpuPkg/ResetVector/Vtf0/Vtf0.in= f > > > > In your FDF FFS file rules sections add: > > [Rule.Common.SEC.RESET_VECTOR] > > diff --git a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf > > b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf > > index 6b406163db..96106a4b11 100644 > > --- a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf > > +++ b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf > > @@ -53,5 +53,7 @@ > > # -DARCH_X64, -DARCH_IA32 > > # * for using 1G page table: > > # -DPAGE_TABLE_1G > > +# * for incresing the 1G page table size (Size in GBs): > > +# -DPAGE_TABLE_1G_SIZE=3D1024 > > # * for different debug channels: > > # -DDEBUG_SERIAL, -DDEBUG_PORT80, or not specify any debug > channel > > diff --git a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm > > b/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm > > index 7960b141be..b080dc5296 100644 > > --- a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm > > +++ b/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm > > @@ -1,7 +1,7 @@ > > > > ;--------------------------------------------------------------------- > > --------- > > ; @file > > ; Emits Page Tables for 1:1 mapping. > > -; If using 1G page table, map addresses 0 - 0x8000000000 (512GB), > > +; If using 1G page table, map addresses 0 - 0x8000000000 (512GB, Size > > +can > > be increse via PAGE_TABLE_1G_SIZE), > > ; else, map addresses 0 - 0x100000000 (4GB) ; ; Copyright (c) 2021 > > - 2023, Intel Corporation. All rights reserved.
> > @@ -39,6 +39,15 @@ BITS 64 > > %define PAGE_PDPTE_1GB(x) ((x << 30) + PAGE_BLE_ATTR) %define > > PAGE_PDE_2MB(x) ((x << 21) + PAGE_BLE_ATTR) > > > > +%ifdef PAGE_TABLE_1G_SIZE > > + %define PAGE_PDPTE_1GB_SIZE PAGE_TABLE_1G_SIZE %else > > + ; > > + ; Default 512GB of 1G Page Table > > + ; > > + %define PAGE_PDPTE_1GB_SIZE 512 > > +%endif > > + > > ALIGN 16 > > > > %ifdef PAGE_TABLE_1G > > @@ -47,7 +56,7 @@ Pdp: > > ; Page-directory pointer table (512 * 1GB entries =3D> 512GB) > > ; > > %assign i 0 > > - %rep 512 > > + %rep PAGE_PDPTE_1GB_SIZE > > DQ PAGE_PDPTE_1GB(i) > > %assign i i+1 > > %endrep > > -- > > 2.39.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111976): https://edk2.groups.io/g/devel/message/111976 Mute This Topic: https://groups.io/mt/102898657/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-