From nobody Fri Dec 19 19:00:40 2025 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+100848+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+100848+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1678270111; cv=none; d=zohomail.com; s=zohoarc; b=De3PQJkfV9uMR1rnJYzyGcOTGmoV6oKSU3gyQUP5PHwHX177iDzA7J/fimbbD9bYCSCMik6KfuGZq6n8rQuUos7HjQ74Ds3HcU3QUQZaORP94EXwc4sdEN49/awoIQ58kaKBMkqwZKc6cnQvbSkhrcRSq+0+UlmXsPTKKjiR/+M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678270111; 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=B5OOTJ4a4/6/orNhWUaICC2foKafq9lHfZRJyoUXong=; b=DJobSEMmntpT/NgTCdPrDkku1G9+hEyRej4xiiW4aeksbTcXPGrjRidcRqohWUngt2uyjZD7HCMnYgkfJd64hB4IP5ArtnSrkFoIpAi7icC1MPxKhxSOiQ0Wp23F0V8GK08QSxxhHrVSmVgK7tGIwQoG182gQQvBTZUnDaEQUe0= 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+100848+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 1678270111036373.6143545914447; Wed, 8 Mar 2023 02:08:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id q98MYY1788612x4U32zWnEp2; Wed, 08 Mar 2023 02:08:30 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.3463.1678270107601358969 for ; Wed, 08 Mar 2023 02:08:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="338442542" X-IronPort-AV: E=Sophos;i="5.98,243,1673942400"; d="scan'208";a="338442542" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 02:08:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="745862450" X-IronPort-AV: E=Sophos;i="5.98,243,1673942400"; d="scan'208";a="745862450" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.92]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 02:08:28 -0800 From: "duntan" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann Subject: [edk2-devel] [Patch V2 01/14] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition Date: Wed, 8 Mar 2023 18:07:45 +0800 Message-Id: <20230308100758.669-2-dun.tan@intel.com> In-Reply-To: <20230308100758.669-1-dun.tan@intel.com> References: <20230308100758.669-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: Cln8iQL7IsmHw6BUYpzgJbCcx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678270110; bh=wP7bfz+j+GyH3DNBtHcgja8cXRT+HDj9sBHtVIUmUUo=; h=Cc:Date:From:Reply-To:Subject:To; b=sTPp/MMIKKdb5heCaZi3OeAbqojuQgz9ImtIHRy0JQIilnpDi1orxvFcF74zZRcyt2m Chg9lHK1T6y4qBa0+HXkAeczxJeP6VR2ZnNGD58ZsX5E+TbvAcUZ1DchFYFaeLQUTBvDO pZ/5WOBKlvY79xPO4opovm4/XgodGvvCJIo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678270112263100002 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 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 (#100848): https://edk2.groups.io/g/devel/message/100848 Mute This Topic: https://groups.io/mt/97469465/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-