From nobody Mon Feb 9 09:36:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+101381+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101381+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1679290464; cv=none; d=zohomail.com; s=zohoarc; b=dQsmKSdD18ZMSL3MLFoWuVcn+syM25TnYs+lbxZe9t5AQSDmqbRTBCSJn22HclB1KOVnCM2vbicOn4hefkqzoav/8Gg8Y+AAyTLO3KGO2r3PS6wTeCUr5P4CG90zQP2IRn2CIgNFL+o/i6AJoa53MbOGACs9WlOSW8wj0b321GY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679290464; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Qt9Myaov1YKu4vMKxss508pYhKzjXsdYxV9gfTDxbac=; b=aP6X6hUHE0shRzP/Q6JjN4UoYCmgIqEd/uyA2DSMB6aquIY61ko5GlpyrRXQkNnh62uKlk7IcD4QG3CsfbpYLRppqqqbLJIb+YRvFGFUEfMjhgjAnmGyIJr2MnFai5Z7DYI+yKOLgdSVuy4c+5JNi9c2LTTaxImjA3hN8ed0vtc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101381+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1679290464883797.3251437805925; Sun, 19 Mar 2023 22:34:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Y8XOYY1788612xHdJRIDffPV; Sun, 19 Mar 2023 22:34:24 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.7469.1679290461311870555 for ; Sun, 19 Mar 2023 22:34:23 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="401155411" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="401155411" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 22:34:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="770059307" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="770059307" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.92]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 22:34:22 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann Subject: [edk2-devel] [Patch V3 01/18] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition Date: Mon, 20 Mar 2023 13:33:12 +0800 Message-Id: <20230320053329.410-2-dun.tan@intel.com> In-Reply-To: <20230320053329.410-1-dun.tan@intel.com> References: <20230320053329.410-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,dun.tan@intel.com X-Gm-Message-State: 2a041pirhT33OAsvc50IcECzx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1679290464; bh=sDDOBvbTVGIukOlFz5EkweiF+4MUI6WHANaUZZGRfyU=; h=Cc:Date:From:Reply-To:Subject:To; b=kxwKaq24sHXyFx5OfcghqCC8Akyp2elTah3v0foQqW7hMeslaMIsi/JIab25XmG2Kks Fc7l3maDJDpke5MVvPSVUM0zVrL92utL8sOyu6NG8gUDPDCGh5hmwY6jWSr2oLPEVwVps WPC8qX5dy2IY/Oo7YcX4Mfz+s44BXVjfmNw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1679290466407100005 Content-Type: text/plain; charset="utf-8" Remove unneeded 'if' condition in CpuPageTableLib code. The deleted code is in the code branch for present non-leaf parent entry. So the 'if' check for (ParentPagingEntry->Pnle.Bits.Present =3D=3D 0) is always FALSE. Signed-off-by: Dun Tan Cc: Eric Dong Reviewed-by: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann --- UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpu= Pkg/Library/CpuPageTableLib/CpuPageTableMap.c index 37713ec659..52535e5a8d 100644 --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c @@ -1,7 +1,7 @@ /** @file This library implements CpuPageTableLib that are generic for IA32 family= CPU. =20 - Copyright (c) 2022, Intel Corporation. All rights reserved.
+ Copyright (c) 2022 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -375,15 +375,6 @@ PageTableLibMapInLevel ( // we need to change PDPTE[0].ReadWrite =3D 1 and let all P= DE[0-255].ReadWrite =3D 0 in this step. // when PDPTE[0].Nx =3D 1 but caller wants to map [0-2MB] as Nx = =3D 0 (PDT[0].Nx =3D 0) // we need to change PDPTE[0].Nx =3D 0 and let all PDE[0-25= 5].Nx =3D 1 in this step. - if ((ParentPagingEntry->Pnle.Bits.Present =3D=3D 0) && (Mask->Bits.Pre= sent =3D=3D 1) && (Attribute->Bits.Present =3D=3D 1)) { - if (Modify) { - ParentPagingEntry->Pnle.Bits.Present =3D 1; - } - - ChildAttribute.Bits.Present =3D 0; - ChildMask.Bits.Present =3D 1; - } - if ((ParentPagingEntry->Pnle.Bits.ReadWrite =3D=3D 0) && (Mask->Bits.R= eadWrite =3D=3D 1) && (Attribute->Bits.ReadWrite =3D=3D 1)) { if (Modify) { ParentPagingEntry->Pnle.Bits.ReadWrite =3D 1; --=20 2.31.1.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 (#101381): https://edk2.groups.io/g/devel/message/101381 Mute This Topic: https://groups.io/mt/97725694/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-