public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter
@ 2022-02-21  6:44 Guomin Jiang
  2022-02-22  5:00 ` Ni, Ray
  2022-02-23 22:42 ` Guo Dong
  0 siblings, 2 replies; 3+ messages in thread
From: Guomin Jiang @ 2022-02-21  6:44 UTC (permalink / raw)
  To: devel; +Cc: Guo Dong, Ray Ni, Maurice Ma, Benjamin You

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3818

It will have some potential issue when memory larger than 2G because
the high memory address will be fill with 0xFFFFFFFF when do the
operation of INTN + INT64 but it is 32 bit normal data in fact.

Should use same data type INT64 + INT64.

V3:
1. Use INT64 as input parameter because all date type is 64 bit
V2:
1. Force the data type to UINTN to avoid high dword be filled with
0xFFFFFFFF
2. Keep INTN because the offset may postive or negative.

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..c8dbb887340b 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  INT64       Delta,
   IN  BOOLEAN     DynamicLinking
   )
 {
-- 
2.35.1.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter
  2022-02-21  6:44 [PATCH v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter Guomin Jiang
@ 2022-02-22  5:00 ` Ni, Ray
  2022-02-23 22:42 ` Guo Dong
  1 sibling, 0 replies; 3+ messages in thread
From: Ni, Ray @ 2022-02-22  5:00 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: Dong, Guo, Ma, Maurice, You, Benjamin

Reviewed-by: Ray Ni <ray.ni@intel.com>

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@intel.com> 
Sent: Monday, February 21, 2022 2:44 PM
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 v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3818

It will have some potential issue when memory larger than 2G because the high memory address will be fill with 0xFFFFFFFF when do the operation of INTN + INT64 but it is 32 bit normal data in fact.

Should use same data type INT64 + INT64.

V3:
1. Use INT64 as input parameter because all date type is 64 bit
V2:
1. Force the data type to UINTN to avoid high dword be filled with 0xFFFFFFFF 2. Keep INTN because the offset may postive or negative.

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..c8dbb887340b 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  INT64       Delta,
   IN  BOOLEAN     DynamicLinking
   )
 {
--
2.35.1.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter
  2022-02-21  6:44 [PATCH v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter Guomin Jiang
  2022-02-22  5:00 ` Ni, Ray
@ 2022-02-23 22:42 ` Guo Dong
  1 sibling, 0 replies; 3+ messages in thread
From: Guo Dong @ 2022-02-23 22:42 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: Ni, Ray, Ma, Maurice, You, Benjamin


Reviewed-by: Guo Dong <guo.dong@intel.com>

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@intel.com> 
Sent: Sunday, February 20, 2022 11:44 PM
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 v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3818

It will have some potential issue when memory larger than 2G because the high memory address will be fill with 0xFFFFFFFF when do the operation of INTN + INT64 but it is 32 bit normal data in fact.

Should use same data type INT64 + INT64.

V3:
1. Use INT64 as input parameter because all date type is 64 bit
V2:
1. Force the data type to UINTN to avoid high dword be filled with 0xFFFFFFFF 2. Keep INTN because the offset may postive or negative.

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..c8dbb887340b 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  INT64       Delta,
   IN  BOOLEAN     DynamicLinking
   )
 {
--
2.35.1.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-23 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21  6:44 [PATCH v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter Guomin Jiang
2022-02-22  5:00 ` Ni, Ray
2022-02-23 22:42 ` Guo Dong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox