From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.1845.1678843411493932650 for ; Tue, 14 Mar 2023 18:23:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=C6FO2Yuc; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678843411; x=1710379411; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=SjM/MB8FFNntks6G3siZi8T88BJ46hMFVyq7UVCgokU=; b=C6FO2YucVWxaOa0/o7TW+ZuqxI27e/r9paqHGY0KX6pIgOrL+Xtgm49r +NhZDZGJ3lAVSq6Ju5zU1GhVWbr4cMRxP+AcrKya5VfgezcXvQFK2ozH3 TCYBuV7DBfaUeQjljITFLCkEKUYJxic30A275dUkvLV0CKEtZQ8FcSwb9 SA+kTBARFjALwVW/0a6RPxvjUpQ3W2MtDUVnMmf4OSP9GzkW3/ODLrQgm +rSMqC+5LUydYdbgu95nqqRDfa0zL2cyrxN6iB1hi58FXZcQf95r4emfP S9P1+Ix6QaTAyxc1C10mVzoCNGWIu7kxtAMZjJAvZ/hqQht+7+hE1ZqSz w==; X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="317981717" X-IronPort-AV: E=Sophos;i="5.98,261,1673942400"; d="scan'208";a="317981717" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2023 18:23:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="629286834" X-IronPort-AV: E=Sophos;i="5.98,261,1673942400"; d="scan'208";a="629286834" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga003.jf.intel.com with ESMTP; 14 Mar 2023 18:23:22 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 14 Mar 2023 18:23:22 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 14 Mar 2023 18:23:21 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Tue, 14 Mar 2023 18:23:21 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Tue, 14 Mar 2023 18:23:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RcpXDsASdB+2IicM+JeFAma8qDbg3dZdCk4jpwkVzDC1TttzA3WFYbOIZN0ynBtaf+KtQO5TYAwLm001KEc5iySvGbInzF1ey+/syA2aeZoPUajDhg4/uSQOQ2HOwALoqu9rYOTN1FqFcVCkOaYOuiIt+YONS1aj0hGsecI3+XtnkrOVcjE4FIF14gHw3x5lYZ56B/57YEySWA0FxJ4zbl7NXedTfADLjueTOPxPKlYIiaTT9jbj+ggwq3YP6U8ImA8CCcmSDcQlOq+Uj+DCXfQNSeSvq8oRKkJiIAaqEWqfXrVBPibD5X+/dFnjZCg94cmF5/3AYQ7c3goOwOH3Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5AEVaR3W5RaD2+oE691mGnLcHZg9CiY3RclwW60gWhY=; b=JKgsdgoc4b3QvPu8YpLaoYiupTl6hAwJOLEkZ7kk4Idt8OESSgCki8ULmQI1bpWqtXcu2gg1WSzRMHmY46wD9kCYwFkiEd4Cb5+BcixCIWU+jWBD1C9dnVtF10oIZnhD2QREUYCuSiLfBOuR8FgFC1c078cewztPZf6vg/CtAgCWG3RwBqm6Qn4BihL/TKq0TGnwUetIMgfBMlM5axnoULexG70eFRYLQkFq5V2UgqgFYwJ6L3swKyTMl/xNCCn2EThpGZA8Jkz1kTLwTJyurrwLg9LRXLbe6FN2p4DI11cGepZyNiUo/134aUGJzbpwzSJujGUH40uPVEsOXCHUqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by PH8PR11MB7118.namprd11.prod.outlook.com (2603:10b6:510:216::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Wed, 15 Mar 2023 01:23:19 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::ae07:e96a:4a24:8a69]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::ae07:e96a:4a24:8a69%7]) with mapi id 15.20.6178.024; Wed, 15 Mar 2023 01:23:19 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann Subject: Re: [Patch V2 01/14] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition Thread-Topic: [Patch V2 01/14] UefiCpuPkg/CpuPageTableLib: Remove unneeded 'if' condition Thread-Index: AQHZUaXz29B2S55VIUW1qsjLO7egQa77FiPA Date: Wed, 15 Mar 2023 01:23:19 +0000 Message-ID: References: <20230308100758.669-1-dun.tan@intel.com> <20230308100758.669-2-dun.tan@intel.com> In-Reply-To: <20230308100758.669-2-dun.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|PH8PR11MB7118:EE_ x-ms-office365-filtering-correlation-id: b14b5f4d-050e-4a90-9b8f-08db24f3dc36 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2l5YbriTk5Cs/5+rBDwj8tBEx8m+Zp65Ncru9dFYxvISM5Vcb0cTSiWvxY+A5r6x0dRhgwboniynpTiGyWfwCsQXj1nMzBXfF1QBzIESbseyu5rH2iinmql9VjNKWzd6kkPU7tRdbvTdf1dMc6r4mWCibLfntLuCXPG9wLxPvUYGC8pp8gZRHvA8WlCAgF5ZOCFE5pJZv1hx1Spg5Y6xDR9EpLxT7eSktCPoGiLXJo3x340xmU0RFemkRpeT0BzgHo1e8VGiUUsjfxpj7FrEkyKZWVBD/IPhCSLn25Zu/x+RSxcQRN4gxbCFT0Uiy8HW6OfGziL+bNKG8XbulWn9fEa4rBCgCCc7wRE2KL+1eMj/7dQv+eOm+9snt0BBuyhjARGyAkw9dhupLarTfRw9jYhOPZo6Pg/BFttqJ8GRea7f1AAUx6c3XTYVmjSOa7Tkb3+h6sLRPeX8KYJnV/NikjCr/WJAPcBHcXTunq9pbZiRsc1E8c1jRntzjI8vtTcsbuCGAZ2EhBgIbNnvbXYqoMB30vSc18VHFXJ/OrlVsXQ2RXvqlYqj1pGymjNu+f/KSyO3Kl9GCRyULJ8RcB0uJK4Lp+pfgZ5F1NZnjtwAI8ZR9ow4SpGCYkXRjJ1F3u0QJETCSDhLnEfsK3XQ+O0DLpf8aPxECu4ET8UdNv1FAViUgLzNwevFRfLfn+eu0vGtPsWAaCJ7aJP2hezXtjO9eg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(39860400002)(396003)(136003)(366004)(346002)(451199018)(5660300002)(8676002)(33656002)(83380400001)(110136005)(478600001)(7696005)(53546011)(6506007)(71200400001)(26005)(66946007)(186003)(9686003)(38070700005)(4326008)(41300700001)(66556008)(66476007)(66446008)(55016003)(52536014)(64756008)(8936002)(316002)(86362001)(76116006)(38100700002)(54906003)(122000001)(82960400001)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rIDr6hPP5QULV1MkWj9s64NAwRlIgigMRxDaA5ERGwkLxwtgUwXGULG+IteG?= =?us-ascii?Q?D92xtVPW6nOEgOZ/fmGICN/BWgf0GLHW0oWKRVNn6HA6JCbxKLLFtVhPqaTu?= =?us-ascii?Q?lenx7LPHy+NfFv/STKz+Aio21rSWbJxiXkO1IsMct9keR13UJNK/LYvyhL83?= =?us-ascii?Q?AhQxG/DosCKNY32VkiG9VemnWQspV6eSjB1nmn/9/A2oSv8iUuJLeCM99GcY?= =?us-ascii?Q?1PmGQEfPoENqOANefpnUye55YE7JzhgLNUd4ln5sVD+Lq0gEHhCp1ijHPS3P?= =?us-ascii?Q?1cIHVtf77p5Hzp3rWg2BtjqgT+oJhDUrEseCeGeT8QCEZJmi/eRTA4NigmTw?= =?us-ascii?Q?nwgCOVMsov6XpGwhN7vO29snMU0MUf5/LWf5AqVFHi8WHdIxJjJ2gAMcI1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+/6Hr0LhlY5Na91zYDV1qGQc1pnKdD?= =?us-ascii?Q?aINxbCw8N3QJ6bIeGLsnTaU2fH2HfkYYCjPx2YNBRNm/c9cKdpEKWoynd5yI?= =?us-ascii?Q?iEEN8I0/0Tc04yjQwrelqd/LBB9ue60iszK5qpnMBNU1TNdrtOYiB+/KsvS2?= =?us-ascii?Q?JiWtMZ54BHRgeYgEt9ngUj0MIr8vnm7JpsCtNnCDSdzaO9OD1RC2BBVz0HUF?= =?us-ascii?Q?uq5WQB+/Ws1+L7LgGF2BlikHyJSzauO1rZO3jxC0tMxdkDonTeWZTGMU8CIF?= =?us-ascii?Q?5w53tRgkXE6A1rZe1puizjJrcIOI9ahG9LlXH/f5?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b14b5f4d-050e-4a90-9b8f-08db24f3dc36 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2023 01:23:19.3120 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qRRl4tFifOb/58N0ir6WmmvVtRTWP80KcoeAMTvR1E6XjffM2e3DcZCo6gHfstIFEMnjsNjU4QyHhdBXVy6vVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB7118 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Dun, The copyright year needs to change to 2023. Code logic change is good to me. Thanks, Ray > -----Original Message----- > From: Tan, Dun > Sent: Wednesday, March 8, 2023 6:08 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray ; Kumar, > Rahul R ; Gerd Hoffmann > Subject: [Patch V2 01/14] UefiCpuPkg/CpuPageTableLib: Remove unneeded > 'if' condition >=20 > 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. >=20 > 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(-) >=20 > diff --git a/UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c > b/UefiCpuPkg/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= PDE[0- > 255].ReadWrite =3D 0 in this step. > // when PDPTE[0].Nx =3D 1 but caller wants to map [0-2MB] as N= x =3D 0 > (PDT[0].Nx =3D 0) > // we need to change PDPTE[0].Nx =3D 0 and let all PDE[0-= 255].Nx =3D 1 in > this step. > - if ((ParentPagingEntry->Pnle.Bits.Present =3D=3D 0) && (Mask->Bits.P= resent > =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.ReadWrite =3D=3D 1) && (Attribute->Bits.ReadWrite =3D=3D 1)) { > if (Modify) { > ParentPagingEntry->Pnle.Bits.ReadWrite =3D 1; > -- > 2.31.1.windows.1