From nobody Thu Apr 25 04:58:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104902+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1684194553404542.2145587683017; Mon, 15 May 2023 16:49:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VSRTYY1788612xXRTYfBNYKS; Mon, 15 May 2023 16:49:13 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.62]) by mx.groups.io with SMTP id smtpd.web10.6840.1684194552127316385 for ; Mon, 15 May 2023 16:49:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F/qub1AYpbDU/Wvc2qI/3PttY5c7C/Qe4mQy4t9GyoYM26c6bdbXWE+yjG1UYM+5dk2MjSifSvEON5W0DSRZ836G6CbOUu//7L+EJipODv2zriU4buRv/stgfEt5KynUfc+5QAr4bWNBbVtWdCcjzGgh3AvmSnRu72TsTy1mukpIZ8DtYie5dwOZsJNQkxVZxscQ0Nv5/QpujrljdeqJzY4PWixuEKlIFclmSP3C1opjE4WXRnLyY4epjRNb/9LeYCRoaSg75SqV8BEJuONDUOgVrTXF+9uco4OZ/+k3VzzEWTLSXhCOX5gGN7dLaIwcBZnfs3VKNJm7UoZ3xBqkYA== 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=axPAV489hvqeiBJMnf3z6oatRhNnz+bgyr+EafKF4Es=; b=PDi9lY9ec4jmxyFK9PLOENz4pyRO6fVcGEBjzxScXxv+aiLxim16las1sVOyhdRAGMMmOsFH+K0qzIyiNaVErF//4Ojc+YL8Nzll4Rlf2tWYEeVfu9smb6ndYACt2zhwMeicxoO6uh23PPjSeeLXVPTmKDLS0uIh8xEfx0Kqp3GQ8pBZr8gwuFYWTC1xp3DWq3qxWKz9yaSaX8En8UeAowfi0kav7sg9L23KVwQ8ZsweNwm+AC84KzYKhgIjZSguX3L1tPrX/bWhsXDd8TqUIFRV+9oaGKP+0HIDzAn/aItCRWjzh3fLf5t+OBX2oq4n9/5GYSQ6XiYFmdF+YZdVDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none X-Received: from BN9PR03CA0206.namprd03.prod.outlook.com (2603:10b6:408:f9::31) by DM4PR12MB6349.namprd12.prod.outlook.com (2603:10b6:8:a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Mon, 15 May 2023 23:49:08 +0000 X-Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f9:cafe::c1) by BN9PR03CA0206.outlook.office365.com (2603:10b6:408:f9::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30 via Frontend Transport; Mon, 15 May 2023 23:49:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104902+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.118.232) by BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.15 via Frontend Transport; Mon, 15 May 2023 23:49:08 +0000 X-Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 15 May 2023 16:49:03 -0700 X-Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 15 May 2023 16:49:03 -0700 X-Received: from 6cd8174ac25c.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Mon, 15 May 2023 16:49:02 -0700 From: "Jeff Brasen via groups.io" To: CC: , , , Jeff Brasen , Ashish Singhal Subject: [edk2-devel] [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with large address Date: Mon, 15 May 2023 23:48:56 +0000 Message-ID: MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT058:EE_|DM4PR12MB6349:EE_ X-MS-Office365-Filtering-Correlation-Id: da45b809-2e4e-4498-b49b-08db559ef9d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: I9NcZGSxkYq4mNnOpi6vbMEz35pv6DCm9dUu6I/yxhNvtpRwtrrqojprG8s1DAQiSEZiwAKYuYgwcOB59zCPMedUj94KDTAnPPjYzXPWsCjS2h/kTXUrXQQtgXSH6bY7BUJFBWs4YHkoDtzkORRvsf8n4NOJdL0PZ93ujq4tL0CCsJrlPeWvZnEJ10kZjYzHZoQxOAVWs/oFkXDlDpx69DD+nAoCCM29VOLP+8Wb2cDKDChnbFGB0E2kGVqtcBDi+xqeN4j4ZYs2EuME6cblHI9wSVKS6tRZZKPQF53gjbA0R/TD02ngv3UgwL59HWflVE0uMWoCfNLQnAIH9vVcHcnkAhGgTM0ANcCsiDbKIaQ2IwqbRP+AYFCwRvwtBaT8VXB7nKQW3yvDPc3OwxTvjZAYPQtoddV4IPBhbFcGT+omFEq/+30qU2PI/hGy7vP+OmCnbxczUQX550lbqWb77jCT58s89gEsmRAfUy6vfMmv3gkFj2ZAWfc2UWrFdw6dFhp1DI4XD/yf5TAH1Q64SYMWmSBXitW7zALFFHreudYvCy6EM9DwVqlg+RA8Jr9HUmjbLeBr6cX1K/qh7gbgNml/OWJYzko3PpwpW5oPhSpxJylRPC2zea4yVRxjbZU8WfUN0r19JxJFkduoNa9jrVoTUZ2iqv6zjmI7TV9zroIDYc6LQCCsFM8BYAe7JsxZc6n9QYM1zmvkgGRPZxot9mWZn2FbHMmFTfSlYPqHZacoPVzh9qzP8zpgXauOBIs4 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2023 23:49:08.5646 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da45b809-2e4e-4498-b49b-08db559ef9d1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6349 Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: YSjoiRXwmrOlZ7YCcGmzrhzwx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684194553; bh=M4lWGGy+9C2JLBzr/kYKWxIkY8e9O8XmXTvghgGMBiI=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=o8pt8qane0kuWsh8aGuBKDe+G5I7EgmQInprS3/A/hj3voFJyNYtGs7e+Nl2KJFaMMJ s6N7Ujmab8ssjXgpDwYgC0JCBPePbavCjV/wiMr8YQZbXsxLItsDdZyICuFK90fQDIfX0 R6l6y6Skf8SerIzoU4NxrhF8WXKAC3sEKuk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684194555263100003 Content-Type: text/plain; charset="utf-8" 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. There are several existing AARCH64 option roms that have base addresses of 0x180000000. 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(-) diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeM= ain.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/Im= age/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->Image= Context.RelocationsStripped) { + if ((PcdGetBool (PcdImageLargeAddressLoad) && ((Image->ImageContext.= ImageAddress) >=3D 0x100000)) || + Image->ImageContext.RelocationsStripped) + { Status =3D CoreAllocatePages ( AllocateAddress, (EFI_MEMORY_TYPE)(Image->ImageContext.ImageCodeMemoryTy= pe), 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. gEfiMdeModulePkgTokenSpaceGuid.PcdTraceHubDebugMmioAddress|0|UINT64|0x30= 001058 =20 + ## Indicates if images with large load address (>0x100000) should attemp= ted to load at specified location. + # If enabled, attempt to allocate at specfied location will be attempte= d 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|BOOLEAN|0x3= 0001059 + [PcdsFixedAtBuild, PcdsPatchableInModule] ## Dynamic type PCD can be registered callback function for Pcd setting = action. # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of= callback function --=20 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 (#104902): https://edk2.groups.io/g/devel/message/104902 Mute This Topic: https://groups.io/mt/98916659/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-