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 02E93AC19B0 for ; Mon, 11 Sep 2023 20:14:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+rpVdNZmMCiOWs614vtIW8STdjBOXzfxiI4WihgdhGQ=; 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=1694463261; v=1; b=wwNsNfxHvNM++HnCma/i12wjAefqD7A1+e0y/wapwC+XvfUn4ohxCQU/X+l1dvMwdbJSLGh2 b0oNnUbKZxq5F1S/E9g+9ZleBgF23fFNchewarf6SB2UPi8MU2FfUlxp2MQh22SzcAPjVK7O8UF CLiXY2RlVJlcvCFpJ5k9dD8g= X-Received: by 127.0.0.2 with SMTP id Rs8hYY7687511xRJ1mkFYAEV; Mon, 11 Sep 2023 13:14:21 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.61]) by mx.groups.io with SMTP id smtpd.web10.8470.1694463260782200651 for ; Mon, 11 Sep 2023 13:14:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HKHaCpSbsUg07xBvHqzz2FmftKtXZS1fJKtB0drkgS+xaCDYjlJ+CBHiMXfL2nnRs6pKNCrK6PV+ECUsme9Iv1PnMfMR9MCR2Ba1r+SbE9OhyeNWrX/YIenIXBDl2RB1cyvKMsp7ztGgBGoaz1HyUcAb0pu/tXkOwtMPQljDPX8XGT651KmDHQAUWbUNiCxVjGb8RnQP9st98EBdKHqt8VvTokqY6TNGrwLElrvNcluENBIUbCIHRrdl71e7pCLkv/HJywsEG+8tr/Ped5VNOJkmyNtK5oc5PDhBf8vstRAKsnLA2PNXX/cxNji6QNF5pgfR+iqtS6V8HWMeqKxi3w== 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=oOi/qPlXxKnCBLGO/hOCB0c1eGOJ3n5fbYCsDYBaio8=; b=DF2NvtPjd86yeALabcga1/LtMO27sL2zpqTPY5E5uWFpNoOkdCkjETSp+8GkueFx1qqYxTrdi0yO6JzkO0TdDvfUPylHtjbWjj7+dyq3Bjhh8PU1rrzkr2dxL4LqdgcJCslaKU5YaoR7ihHpsov7XpnkQm+yqwG3/bQ6DjNVUXBqsXwsQBqBCi0qkblBtkyz/AJD7tSuc2GLBbbFJT9UbgmkbFWDC5q3FdFMFVtNg1CZ2YrGxn2SMKMf8DzoEYCTjAoXomGEiaft8IBEpz+sGrr7tnAIoCqyeoNHpVgMfO9/vS+QZhEv/qQK6Emi1tm6rPuttTIX3XlkDZcSJ2uGJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from DS7PR12MB5789.namprd12.prod.outlook.com (2603:10b6:8:74::21) by SJ1PR12MB6172.namprd12.prod.outlook.com (2603:10b6:a03:459::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.30; Mon, 11 Sep 2023 20:14:18 +0000 X-Received: from DS7PR12MB5789.namprd12.prod.outlook.com ([fe80::ed5e:f299:fc26:f571]) by DS7PR12MB5789.namprd12.prod.outlook.com ([fe80::ed5e:f299:fc26:f571%4]) with mapi id 15.20.6768.029; Mon, 11 Sep 2023 20:14:18 +0000 From: "Jeff Brasen via groups.io" To: "devel@edk2.groups.io" CC: "jian.j.wang@intel.com" , "gaoliming@byosoft.com.cn" , "dandan.bi@intel.com" , Ashish Singhal Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with large address Thread-Topic: [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with large address Thread-Index: AQHZh4fZtUhrEVBB/kGqYkEodk0CkrAWydow Date: Mon, 11 Sep 2023 20:14:18 +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: DS7PR12MB5789:EE_|SJ1PR12MB6172:EE_ x-ms-office365-filtering-correlation-id: b1198701-40a1-42b7-e437-08dbb303ada1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: vFnW8vaqTIuQ0CJFJSo9GI5YWEqVNMBDsxWguC8+/s++/jhijBNi+K8EjHhwMtJC0thlc4CnkHY+sArCQwycOTVsYhLZW7FtWEUdYLyY5Them0l2QcUOjccHgCVoFwAPCkbEOUchBcQM9XGt7Xrk4SCnUX3QjJTbqemcXVyOcHMWgG4Iy4pOtG6kUgthXfXVbdS2Cgi9pyxokg8NUDV1MMX1HSpSIy7CIBs1jnACY5q3q+gzwIahdAJxB4HY4dmWV+9l7A6ssJs0ia1JQKNCYUEM4zyQMOc8IYp7QVclki/bivY/tibkA41BFoE2VqAxn18mSFGVdYTPnMJ89fIhUxe3C19EcRW04zFKPPW251epDK0Z7h6jaSgb2A34gXRC0dNmlH+VaGSdcfrUmXTCQ4O/nuxNaXy/LnRSa4r3LLRGC26ZoR9zgf9vTiIIIbbpeEDA57OjXyAKnlx4QYdNV/htP0AtDsxVKZCeWZ4+mz+175/LaiqxaAz5V76jYV8ZyCIVWeyBhGMI/hz2DHakzGU39SjOj1FeX7vQNrqKC396iiCQeVuZV1WrhbpfmA95fT6sASs/4IStE3gd3DyDAFFfPAyWuphWOylJyvhNWEL/S46AdYP8dynutuZA9Y4h x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?KFhT/7p2QHwVZj1T1CmZV+/RXSk7/a2vYJ471zIEwDGqAcjQ6fmUXnFZnghu?= =?us-ascii?Q?ltDsXywyzI9V4xzKPMqXZukb2PJZt4P9j3KrObUjVu4iAqypSY6E8Teggo0T?= =?us-ascii?Q?KKvEBXlo4KF+DAXu9Iqio65AQS59wN9OKcY2hIzUh6q/9F6z2qNppqhLDB8E?= =?us-ascii?Q?e19tHC74Szpdy18NENhr/nVazrH/KsIuUb5Kg2O7rbsQH1qMcV8L/qAEdTWr?= =?us-ascii?Q?zICqTHQoga7PMfkNnDFWEixGjulw84yoDlr4UQ+of+EMAhjGJahsijncaUDk?= =?us-ascii?Q?8U9RnHpsec2XajgSYv9cUjD7Kpxo1MrBwJBPQA5hx9qxravUaDbLLJIxzY4L?= =?us-ascii?Q?JwxZfFeowqA6hhzV8AM61eHSXSvCqBwmBCgWsYJDUeVAfLqPmMD/npW7S+1M?= =?us-ascii?Q?yGIqfdmQQ74PAhtBL1BW612Zmg++LApkrvbC5FHEi3fw5coQHrdoaxxQXCt2?= =?us-ascii?Q?PnwqTJ9wDtRZXP7vPKjCKVX56Ulbzx8wteMhVZNxXw/aYIiHVRMw2bQ+Vsqi?= =?us-ascii?Q?SC16NF1FB1ELga4ucjYvjzYHCNiesQ4VreY/3BccqRhQdVdE05re90TF7uM3?= =?us-ascii?Q?/Xe5T+kXaCWC3oJhGLf8gfaXNUq4qSfN5Qb36qdiQMmNvJzUPuZpuvIxEDub?= =?us-ascii?Q?O44j+0BlS/JQPkg90uUU3ee1jbFdNMI1G7GTXBFY+cMy0K8oA6HZH63MBSQK?= =?us-ascii?Q?OJaBljWb7+z6lInmE3Ie8FknqZ36cD4gODlNlIpYBo/pqQfN7TN1U/jc0aim?= =?us-ascii?Q?Zu48q/RwOQvLI7KoEayiJWfkekZHA6PtIJt79toXRLyG44YGLoLQ186B7HwL?= =?us-ascii?Q?ilCo8qeitkwlU9SFdrX/As5ue/CxTrPQ/uLNyeaxnlJRlRfKiJRAWC6ZLgeU?= =?us-ascii?Q?yQSmv45bCqyrjQ/lEpb8dA8lIhZcXBxRzPu80aV4PGfey6jldByYzszhHkdg?= =?us-ascii?Q?rc4mcoeuToJdYfYHyFPmZqh0dSUxh3FFOxSsreg3ycAItX+ALTrOGLsbUs6s?= =?us-ascii?Q?BQws4qxSznOldSI/ES0nQNjEM2tiU5s/QsBp+hMnUxEmhu8LpPSr6eIJM2TH?= =?us-ascii?Q?bgudiN8sPiiIwtxOqoCXpmWobNRf0SMt1HuE/YtU02dvoNkmWC8ZOz9BE5cg?= =?us-ascii?Q?B3DGWSkfBXKZo1+jiR1IR1F3oSiqk5DCSWcJfdfLE8ZI8UbdEu/cvPdlabHt?= =?us-ascii?Q?YR9AlZtWC+S19dTj54dP3tfZWkm83Ux8pz05kCB398hbIhP4vhkD+Nfx0RRb?= =?us-ascii?Q?X/YA4vjkXXz1JNTrN+hewka4lVadPJm4jfJ4hM2bQcXpZ+yZg3X2O7j5Qewz?= =?us-ascii?Q?+qa8XeWMxJ9e0RpmtElPCZA7THWnfPocqb6IG9Nl/Ix75iiCbBMIV58d4jN8?= =?us-ascii?Q?y+PqbyKulxVIQE4mUM2RjDz4hw3xn/wxgatUyvAeCXGredznG2HQmuE7CftG?= =?us-ascii?Q?Kn7wEDblHfLgjNXgd6vdZ40XibQ9yQcyc426judSPXAoidCEAQdh94Z/ohF6?= =?us-ascii?Q?pc1eTSxoArd5hTF4leR9dMD8w1CFF8EfGY1d7JltSA+ipV0tUsD9ghlk8WHq?= =?us-ascii?Q?RKzlVwR04wiWCfU3Qe+g7VlZti5yQ1vZq6gC09mQ?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB5789.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1198701-40a1-42b7-e437-08dbb303ada1 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Sep 2023 20:14:18.2150 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CDPYG6qgN7CowNexRIoPiqK4o6lPdrIGWRoOavF4KlPA+fV4Bxg0mnilCWfiwnJLMn8+0rCpynUrKBKd+qvAxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6172 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,jbrasen@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ZqaRzwQkza9n7iePej2sla4Bx7686176AA= 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=wwNsNfxH; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=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 Any thoughts/feedback on this patch? Thanks, Jeff > -----Original Message----- > From: Jeff Brasen > Sent: Monday, May 15, 2023 5:49 PM > To: devel@edk2.groups.io > Cc: jian.j.wang@intel.com; gaoliming@byosoft.com.cn; dandan.bi@intel.com; > Jeff Brasen ; Ashish Singhal > > Subject: [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with > large address >=20 > Add PCD to control if modules with start addresses in PE/COFF > 0x100000 > attempt to load at specified address. > If a module has an address in this range and there is untested memory > DxeCore will attempt to promote all memory to tested which bypasses any > memory testing that would occur later in boot. >=20 > There are several existing AARCH64 option roms that have base addresses o= f > 0x180000000. >=20 > Signed-off-by: Jeff Brasen > Reviewed-by: Ashish Singhal > --- > MdeModulePkg/Core/Dxe/DxeMain.inf | 1 + > MdeModulePkg/Core/Dxe/Image/Image.c | 4 +++- > MdeModulePkg/MdeModulePkg.dec | 7 +++++++ > 3 files changed, 11 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf > b/MdeModulePkg/Core/Dxe/DxeMain.inf > index 35d5bf0dee..16871f2021 100644 > --- a/MdeModulePkg/Core/Dxe/DxeMain.inf > +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf > @@ -187,6 +187,7 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask > ## CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard = ## > CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdFwVolDxeMaxEncapsulationDepth > ## CONSUMES > + gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad > ## CONSUMES >=20 > # [Hob] > # RESOURCE_DESCRIPTOR ## CONSUMES > diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c > b/MdeModulePkg/Core/Dxe/Image/Image.c > index 9dbfb2a1fa..6bc3a549ae 100644 > --- a/MdeModulePkg/Core/Dxe/Image/Image.c > +++ b/MdeModulePkg/Core/Dxe/Image/Image.c > @@ -680,7 +680,9 @@ CoreLoadPeImage ( > ); > } > } else { > - if ((Image->ImageContext.ImageAddress >=3D 0x100000) || Image- > >ImageContext.RelocationsStripped) { > + if ((PcdGetBool (PcdImageLargeAddressLoad) && ((Image- > >ImageContext.ImageAddress) >=3D 0x100000)) || > + Image->ImageContext.RelocationsStripped) > + { > Status =3D CoreAllocatePages ( > AllocateAddress, > (EFI_MEMORY_TYPE)(Image- > >ImageContext.ImageCodeMemoryType), > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec index 95dd077e19..6fd1bd7b8f > 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -1116,6 +1116,13 @@ > # @Prompt Output MMIO address of Trace Hub message. >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdTraceHubDebugMmioAddress|0|UIN > T64|0x30001058 >=20 > + ## Indicates if images with large load address (>0x100000) should > attempted to load at specified location. > + # If enabled, attempt to allocate at specfied location will be attemp= ted with > a fall back to any address. > + # TRUE - UEFI will attempt to load at specified location.
> + # FALSE - UEFI will load at any address
> + # @Prompt Enable large address image loading. > + > + > gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad|TRUE|BOOL > EAN|0 > + x30001059 > + > [PcdsFixedAtBuild, PcdsPatchableInModule] > ## Dynamic type PCD can be registered callback function for Pcd settin= g > action. > # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum > number of callback function > -- > 2.25.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 (#108497): https://edk2.groups.io/g/devel/message/108497 Mute This Topic: https://groups.io/mt/98916659/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-