From nobody Tue Feb 10 05:17:31 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+100685+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+100685+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1677837832; cv=none; d=zohomail.com; s=zohoarc; b=G1XlY5a5zAuuzYq+p63EOvjw96QZ/h028w5SvTxIlk3+F8FSApgc85gmQaZz0enNwRgW8VpslsBMXv263qesG6Vh8VcV7Qw22geiwvvHBkmYjDfxOQfU0ro+ccBGrfZdanxk7HvGSkm3BXGicptHFnu/lrEkmiXQmcaE+1BbZx8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677837832; 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=HlsJq6aINIHyuXMKoqsac5H2sVDHpNxQtWzxIWU39pY=; b=IgK1C6p2FL2XgNVodyyGqqjlCoRU9CuwPbwFoTrXs6tSWpbMafHiQSkMldmo2bAqeKtxhMYkyxDtNV0ak6qJgo1tPHquaryU8SE5McO9Iq2nrPABP3dFnulOQb79VORAjTJM1dTIP/VE+XOAb0S+psCEnKNiXtD2GpPdVkQzEm4= 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+100685+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 1677837832385427.24488092883644; Fri, 3 Mar 2023 02:03:52 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7MqoYY1788612xr2rW1VbpzQ; Fri, 03 Mar 2023 02:03:52 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.19850.1677837828807486048 for ; Fri, 03 Mar 2023 02:03:51 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="318831650" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="318831650" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 02:03:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="818420967" X-IronPort-AV: E=Sophos;i="5.98,230,1673942400"; d="scan'208";a="818420967" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.92]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 02:03:50 -0800 From: "duntan" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann Subject: [edk2-devel] [PATCH 1/6] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition Date: Fri, 3 Mar 2023 18:03:31 +0800 Message-Id: <20230303100336.2138-2-dun.tan@intel.com> In-Reply-To: <20230303100336.2138-1-dun.tan@intel.com> References: <20230303100336.2138-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: 42y4mnR3S1lqPFXs4Xr9KPoUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1677837832; bh=F0igOjWV9Hxrg3qjifQdvBYLJ+CKwaWQveau5PaQXXg=; h=Cc:Date:From:Reply-To:Subject:To; b=wYy6+fkEmHkiOLhgfpAXIZzZ+oqerWJji6iXLC/R+oHmilLmjxy1dtMlzvaNH9D0Uru Y4RgKAdsYdVxIr9FncUhbPOPtE6gsElFxYsBcSSPTanIcjE1tzS8mT3MXl4L6nrFS4HKE Bz7KrGsVGnegPeP3KoBxhZ5xNQ0BXutavD4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1677837834433100001 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 check for (ParentPagingEntry->Pnle.Bits.Present =3D=3D 0) won't is always FALSE. Signed-off-by: Dun Tan Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann --- UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c b/UefiCpu= Pkg/Library/CpuPageTableLib/CpuPageTableMap.c index 37713ec659..47027917d9 100644 --- a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c +++ b/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c @@ -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 (#100685): https://edk2.groups.io/g/devel/message/100685 Mute This Topic: https://groups.io/mt/97358970/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-