From nobody Sat Nov 2 12:31:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488849547783693.2968423532843; Mon, 6 Mar 2017 17:19:07 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1BCAF80343; Mon, 6 Mar 2017 17:19:06 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CF79380331 for ; Mon, 6 Mar 2017 17:19:04 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2017 17:19:04 -0800 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by orsmga003.jf.intel.com with ESMTP; 06 Mar 2017 17:19:03 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,256,1484035200"; d="scan'208";a="941341197" From: Hao Wu To: edk2-devel@lists.01.org Date: Tue, 7 Mar 2017 09:18:55 +0800 Message-Id: <20170307011855.8884-1-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 Subject: [edk2] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Refine casting result to bigger size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hao Wu , Jeff Fan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The commit is a follow-up of commit 8491e30. In file MpService.c line 786: Pte[Index] =3D (UINT64)((UINTN)PageTable + EFI_PAGE_SIZE * (Index + 1)) | mAddressEncMask ... (Where PageTable is of type VOID*, Index is of type UINTN, mAddressEncMask is of type UINT64 and Pte[Index] is of type UINT64.) Since in this case, the code logic ensures that the expression will not exceed the range of UINTN, the commit will remove the explicit type cast '(UINT64)'. Cc: Jeff Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Jeff Fan --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxe= Smm/MpService.c index d99ad467b7..a1d16b4570 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -1,7 +1,7 @@ /** @file SMM MP service implementation =20 -Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.
=20 This program and the accompanying materials @@ -783,7 +783,7 @@ Gen4GPageTable ( // Set Page Directory Pointers // for (Index =3D 0; Index < 4; Index++) { - Pte[Index] =3D (UINT64)((UINTN)PageTable + EFI_PAGE_SIZE * (Index + 1)= ) | mAddressEncMask | + Pte[Index] =3D ((UINTN)PageTable + EFI_PAGE_SIZE * (Index + 1)) | mAdd= ressEncMask | (Is32BitPageTable ? IA32_PAE_PDPTE_ATTRIBUTE_BITS : PAG= E_ATTRIBUTE_BITS); } Pte +=3D EFI_PAGE_SIZE / sizeof (*Pte); --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel