From nobody Fri Apr 26 01:09:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+46874+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46874+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1567664377; cv=none; d=zoho.com; s=zohoarc; b=k7kCp8KXRnch2TRH5HzKLScdMvM/8GLgEeai2LMSLIFH7550/T8xli6smh5B2ZJ1534R9fdJblFASa9kl+LawwKATKylpYjWQZ8a1VSvQz1Pb27Cx8cpiFYj629YhdrBFyyZaLITAcKjZK35B/mSSAxyTbAFxcKgSjUUgkXVwWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567664377; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=W5lhCZMeQCKIYP4UEssS9ofe+s/JyUIeerA/wBPFUiA=; b=U5CoajVgYXhaBN4ifM0IJzpO+PzHJfSvoqP1221JN5munoluHjJNlsiHG9f/Op4s2ErUbcdp4gi89kWd4MuNDPeEoKyYieU1aN2vNThGtVGGdU0v3SQXuHWsXRdz1oHc1OTySg20WdpnXS8RWwjeZi1pG1shAWvbNzyLqwkSi1w= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46874+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1567664377810158.83081187962728; Wed, 4 Sep 2019 23:19:37 -0700 (PDT) Return-Path: X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Wed, 04 Sep 2019 23:19:36 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 23:19:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,469,1559545200"; d="scan'208";a="187872153" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga006.jf.intel.com with ESMTP; 04 Sep 2019 23:19:34 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Michael Kubacki , Chasel Chiu , Nate DeSimone , Liming Gao Subject: [edk2-devel] [PATCH v2] MinPlatformPkg/SecFspWrapperPlatformSecLib: Change TopOfTemporaryRam type Date: Thu, 5 Sep 2019 14:19:32 +0800 Message-Id: <20190905061932.28428-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: 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,shenglei.zhang@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1567664377; bh=RwEAkDAbynzqpEqRciwvDaOJ0M6Xo8xq+ihxXWZMVfE=; h=Cc:Date:From:Reply-To:Subject:To; b=lJHaJ5GH2KGiDt4MLBWFpbKgpt33edmZmhXy2MSCKAujzJ+voTEwTP28k4Z1j58aF6D uxjS5W8GwBOF88JmyoUapHaRTfXJXKFX39iZZjYCPxvRoxTAk9gvUh0HVmSPVKYh5XrpC AA1iJ7II3vt50CnKwgpPhXYPSeqkLzNHa+s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Update the type of TopOfTemporaryRam from UINT32 to UINTN. This change is intended to support X64 build scenarios. The original code(line 64) may cast the overfloewed result produced by "(TopOfTemporaryRam - sizeof (UINT32))"from 32bit to 64bit. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang Reviewed-by: Chasel Chiu Reviewed-by: Michael Kubacki --- v2: As TopOfTemporaryRam is defined as UINTN in v2, remove all the related casting operations which exist in v1 patch.=20 .../SecFspWrapperPlatformSecLib/SecGetPerformance.c | 8 ++++---- .../SecFspWrapperPlatformSecLib/SecPlatformInformation.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapper= PlatformSecLib/SecGetPerformance.c b/Platform/Intel/MinPlatformPkg/FspWrapp= er/Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c index c4eeb2b1..8535ae04 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/SecGetPerformance.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/SecGetPerformance.c @@ -41,7 +41,7 @@ SecGetPerformance ( { UINT32 Size; UINT32 Count; - UINT32 TopOfTemporaryRam; + UINTN TopOfTemporaryRam; UINT64 Ticker; VOID *TopOfTemporaryRamPpi; EFI_STATUS Status; @@ -77,12 +77,12 @@ SecGetPerformance ( // | TSC[31:00] | // |--------------| // - TopOfTemporaryRam =3D (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof(UINT3= 2); + TopOfTemporaryRam =3D (UINTN)TopOfTemporaryRamPpi - sizeof(UINT32); TopOfTemporaryRam -=3D sizeof(UINT32) * 2; - Count =3D *(UINT32 *) (UINTN) (TopOfTemporaryRam - sizeof (U= INT32)); + Count =3D *(UINT32 *)(TopOfTemporaryRam - sizeof (UINT32)); Size =3D Count * sizeof (UINT32); =20 - Ticker =3D *(UINT64 *) (UINTN) (TopOfTemporaryRam - sizeof (UINT32) - Si= ze - sizeof (UINT32) * 2); + Ticker =3D *(UINT64 *) (TopOfTemporaryRam - sizeof (UINT32) - Size - siz= eof (UINT32) * 2); Performance->ResetEnd =3D GetTimeInNanoSecond (Ticker); =20 return EFI_SUCCESS; diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapper= PlatformSecLib/SecPlatformInformation.c b/Platform/Intel/MinPlatformPkg/Fsp= Wrapper/Library/SecFspWrapperPlatformSecLib/SecPlatformInformation.c index 5b94ed2b..ade36ab5 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/SecPlatformInformation.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatfor= mSecLib/SecPlatformInformation.c @@ -36,7 +36,7 @@ SecPlatformInformation ( UINT32 *Bist; UINT32 Size; UINT32 Count; - UINT32 TopOfTemporaryRam; + UINTN TopOfTemporaryRam; VOID *TopOfTemporaryRamPpi; EFI_STATUS Status; =20 @@ -59,9 +59,9 @@ SecPlatformInformation ( // This routine copies the BIST information to the buffer pointed by // PlatformInformationRecord for output. // - TopOfTemporaryRam =3D (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof (UINT= 32); + TopOfTemporaryRam =3D (UINTN)TopOfTemporaryRamPpi - sizeof (UINT32); TopOfTemporaryRam -=3D sizeof(UINT32) * 2; - Count =3D *((UINT32 *)(UINTN) (TopOfTemporaryRam - sizeof (U= INT32))); + Count =3D *((UINT32 *)(TopOfTemporaryRam - sizeof (UINT32))); Size =3D Count * sizeof (IA32_HANDOFF_STATUS); =20 if ((*StructureSize) < (UINT64) Size) { --=20 2.18.0.windows.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 (#46874): https://edk2.groups.io/g/devel/message/46874 Mute This Topic: https://groups.io/mt/33150686/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-