From: "Jeff Brasen via groups.io" <jbrasen=nvidia.com@groups.io>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "jian.j.wang@intel.com" <jian.j.wang@intel.com>,
"gaoliming@byosoft.com.cn" <gaoliming@byosoft.com.cn>,
"dandan.bi@intel.com" <dandan.bi@intel.com>,
Ashish Singhal <ashishsingha@nvidia.com>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with large address
Date: Mon, 11 Sep 2023 20:14:18 +0000 [thread overview]
Message-ID: <DS7PR12MB57890609A4D6A3FFF6648D8ECBF2A@DS7PR12MB5789.namprd12.prod.outlook.com> (raw)
In-Reply-To: <bd36c9c24158590db2226ede05cb8c2f50c93a37.1684194452.git.jbrasen@nvidia.com>
Any thoughts/feedback on this patch?
Thanks,
Jeff
> -----Original Message-----
> From: Jeff Brasen <jbrasen@nvidia.com>
> 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 <jbrasen@nvidia.com>; Ashish Singhal
> <ashishsingha@nvidia.com>
> Subject: [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with
> large address
>
> 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 <jbrasen@nvidia.com>
> Reviewed-by: Ashish Singhal <ashishsingha@nvidia.com>
> ---
> 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 >= 0x100000) || Image-
> >ImageContext.RelocationsStripped) {
> + if ((PcdGetBool (PcdImageLargeAddressLoad) && ((Image-
> >ImageContext.ImageAddress) >= 0x100000)) ||
> + Image->ImageContext.RelocationsStripped)
> + {
> Status = 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.<BR>
> + # FALSE - UEFI will load at any address<BR>
> + # @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 setting
> action.
> # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum
> number of callback function
> --
> 2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
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]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2023-09-11 20:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 23:48 [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with large address Jeff Brasen
2023-09-11 20:14 ` Jeff Brasen via groups.io [this message]
2023-10-04 14:38 ` [edk2-devel] " Jeff Brasen via groups.io
2023-10-07 5:23 ` [edk2-devel] 回复: " gaoliming via groups.io
2023-10-30 17:27 ` [edk2-devel] " Jeff Brasen via groups.io
2023-10-31 13:42 ` Laszlo Ersek
2023-10-31 15:27 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DS7PR12MB57890609A4D6A3FFF6648D8ECBF2A@DS7PR12MB5789.namprd12.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox