From: "Ma, Maurice" <maurice.ma@intel.com>
To: "Jiang, Guomin" <guomin.jiang@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Dong, Guo" <guo.dong@intel.com>, "Ni, Ray" <ray.ni@intel.com>,
"You, Benjamin" <benjamin.you@intel.com>
Subject: Re: [PATCH 1/1] UefiPayloadPkg/PayloadLoaderPeim: Replace Delta type INTN with UINTN
Date: Tue, 1 Feb 2022 22:58:03 +0000 [thread overview]
Message-ID: <CO1PR11MB4945BC584787D30F6E001BBA89269@CO1PR11MB4945.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220129083032.524-1-guomin.jiang@intel.com>
Shouldn't "Delta" be INTN type ? It can be either positive or negative, right ?
For the case you explained below, I think the caller should pass in INTN type instead of UINTN.
So maybe a better fix is to change "UINTN Delta" to "INTN Delta" in the caller function RelocateElf64Sections() inside file UefiPayloadPkg\PayloadLoaderPeim\ElfLib\Elf64Lib.c.
Thanks
Maurice
> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Saturday, January 29, 2022 0:31
> To: devel@edk2.groups.io
> Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma,
> Maurice <maurice.ma@intel.com>; You, Benjamin
> <benjamin.you@intel.com>
> Subject: [PATCH 1/1] UefiPayloadPkg/PayloadLoaderPeim: Replace Delta
> type INTN with UINTN
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3818
>
> ProcessRelocation64 use INTN Delta. However it force it to UINTN when call
> it.
>
> It will have some potential issue when memory larger than 2G because the
> high memory address will be fill with 0xFFFFFFFF if use INTN.
>
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> ---
> UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> index dc47a05c6e4a..ee530322d7ed 100644
> --- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> +++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> @@ -108,7 +108,7 @@ ProcessRelocation64 (
> IN UINT64 RelaSize,
> IN UINT64 RelaEntrySize,
> IN UINT64 RelaType,
> - IN INTN Delta,
> + IN UINTN Delta,
> IN BOOLEAN DynamicLinking
> )
> {
> --
> 2.30.0.windows.2
prev parent reply other threads:[~2022-02-01 22:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-29 8:30 [PATCH 1/1] UefiPayloadPkg/PayloadLoaderPeim: Replace Delta type INTN with UINTN Guomin Jiang
2022-02-01 22:39 ` Guo Dong
2022-02-01 22:58 ` Ma, Maurice [this message]
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=CO1PR11MB4945BC584787D30F6E001BBA89269@CO1PR11MB4945.namprd11.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