From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web09.7804.1645425885791484961 for ; Sun, 20 Feb 2022 22:44:46 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Qvy6aRis; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: guomin.jiang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645425885; x=1676961885; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jcL6iSFv/J74kW3nTWo5hnf1Vo8AI/B6zznKiVR2AC0=; b=Qvy6aRis2eQziIwKEHrE7fIQbsXC0KdLWeUHcSeOqdvqLM6ubtqhRpIe moVfMbesX8/hPgcyOvSpje+F7P0xyrtvUeEyuJ6CdxVTnORDkudXqXr4I q5AnpJgoyR2Wdtfz2wvmBjBgrPQUbvhzHxhAXoc8BIl38uu+mgm3AHTQ+ TFG9i+UlUwmp9NCOg6S10h2zb9oGpTqS5J2xNLjCoX1W+EBF0RimtyQdA 0LTFqtMJjLOv2wZN45qBI05wARN3TNqsyCFkygZp4n1PguXWx6WvzVbIB zNHbSZ94fYTD+ZzSIdeEb5VKyyYP3SYM7wtWFRmCtD9NJKm7x9fVjuGEo Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="238860238" X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="238860238" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2022 22:44:44 -0800 X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="627279126" Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.15.53]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2022 22:44:43 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Maurice Ma , Benjamin You Subject: [PATCH v3 1/1] UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter Date: Mon, 21 Feb 2022 14:44:28 +0800 Message-Id: <20220221064428.1846-1-guomin.jiang@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Signed-off-by: Guomin Jiang --- 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