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 3276878003C for ; Sat, 7 Oct 2023 05:23:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=pyoJYI0FkvzKLFmcCLVT1Oke28RVYhepZMe2PHM1koI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20140610; t=1696656211; v=1; b=m9xcxb1wWf0O4EmgQpwbercILnpOaDBbCSlgsma+bNtKlTc035rOQRqM9a2+souahhSKZF7u oFZSpQHCRR8NtC524abkikrl1kTuvHt/EXGZvIGA0UTZacOzpGZ5sPsvy5STj7qtdYLDKvbp651 h9JzxwXu8xxGn5aCQ962i0oE= X-Received: by 127.0.0.2 with SMTP id YP42YY7687511xoN42fDuzMU; Fri, 06 Oct 2023 22:23:31 -0700 X-Received: from zrleap.intel-email.com (zrleap.intel-email.com [114.80.218.36]) by mx.groups.io with SMTP id smtpd.web10.12921.1696656209420339227 for ; Fri, 06 Oct 2023 22:23:31 -0700 X-Received: from zrleap.intel-email.com (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 5BC66A32E0A0 for ; Sat, 7 Oct 2023 13:23:26 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 48A2CA32E09B for ; Sat, 7 Oct 2023 13:23:26 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by zrleap.intel-email.com (Postfix) with SMTP id 92869A32E0F3 for ; Sat, 7 Oct 2023 13:23:22 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP(SSL) for ; Sat, 07 Oct 2023 13:23:08 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: "'Jeff Brasen'" , Cc: , , "'Ashish Singhal'" , References: In-Reply-To: Subject: =?UTF-8?B?W2VkazItZGV2ZWxdIOWbnuWkjTogW1BBVENIXSBNZGVNb2R1bGVQa2cvRHhlQ29yZTogQWxsb3cgcmVsb2NhdGlvbiBvZiBpbWFnZXMgd2l0aCBsYXJnZSBhZGRyZXNz?= Date: Sat, 7 Oct 2023 13:23:07 +0800 Message-ID: <081301d9f8de$5bad6a20$13083e60$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQFJR70JjEjuJTTKDy6S+ZBviKA/PgIR1WM3sU6eEwA= 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,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: BmRfHRUsDNm2f885AGBzBHwgx7686176AA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=m9xcxb1w; 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 Jeff: I have no better solution than your proposal for this problem. So, this patch is good to me. Reviewed-by: Liming Gao Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Jeff Brasen > =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA9=D4=C212=C8=D5 4:14 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: jian.j.wang@intel.com; gaoliming@byosoft.com.cn; > dandan.bi@intel.com; Ashish Singhal > =D6=F7=CC=E2: RE: [PATCH] MdeModulePkg/DxeCore: Allow relocation of image= s with > large address >=20 > Any thoughts/feedback on this patch? >=20 > Thanks, > Jeff >=20 >=20 > > -----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 > > > > Add PCD to control if modules with start addresses in PE/COFF > 0x10000= 0 > > 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/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 > > > > # [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. > > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdTraceHubDebugMmioAddress|0|UIN > > T64|0x30001058 > > > > + ## 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 attempted > 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|BOO > L > > EAN|0 > > + x30001059 > > + > > [PcdsFixedAtBuild, PcdsPatchableInModule] > > ## Dynamic type PCD can be registered callback function for Pcd setting > > 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 (#109380): https://edk2.groups.io/g/devel/message/109380 Mute This Topic: https://groups.io/mt/101812485/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-