From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.91928.1679624365205386081 for ; Thu, 23 Mar 2023 19:19:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=WGKLq46B; spf=pass (domain: intel.com, ip: 192.55.52.93, 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=1679624365; x=1711160365; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=dvO6iguoihQNgcbvtj+diXQzPBkzbfH1v8IDtAVM/Yw=; b=WGKLq46B7yWPahm3Svg8AIGeOFU4BAThDh6H8mTeZBx9LZ+tm60KWmBX zJQ8v6pH4M7J1DH2Q1ci4SkwMnw1+IqAN7o0zfCEECla4AW7PhxqqWJ7u A587++mE2PNnPPy+7EWUaWUL+lO80/C0Ahx56mfQKEbgLDDrT8mNgXsmm S7SPfM7grUMwYchY8Y7zply3l3UYRA+E0XqMjjK46LZ2l+NdteBrhLBkx k/CYegnjd+dm0P3BcMCoRT/OxJWW35mWxV+0XAhPF+940FAWThge/OmaO X4FWUyXkEGGkwIc/BwhzMXhv/emf/w81Wppfg5hABVlisgmq6YT+6Adha w==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="337185180" X-IronPort-AV: E=Sophos;i="5.98,286,1673942400"; d="scan'208";a="337185180" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 19:19:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="771691814" X-IronPort-AV: E=Sophos;i="5.98,286,1673942400"; d="scan'208";a="771691814" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by FMSMGA003.fm.intel.com with ESMTP; 23 Mar 2023 19:19:24 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 23 Mar 2023 19:19:24 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Thu, 23 Mar 2023 19:19:24 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Thu, 23 Mar 2023 19:19:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bveGH/2I65N6t0xr3KomXucLfm/doJnuaCdjdDBauup+vE47FVLbEmQoKW4UQaUy/0qGIvdnrju3r2Y4/R1SB8asDk1r/wmD0CKRWNR7bfMglrB73E3l91UVAZesP3WggRKcL19Toxah1l7erQ1wATbyKWACuAO/fhzcODDipSuFNtwaaB577Q29itIOhW26tIs4FgyBqam33EiQgzsdxq8MTbxgUNRMPkw43kKRTh3tyLqd3yBNTDk9XqNwuF24j9mO9wOsd76uiwgWiNjcCFBM4jtbIVeYg4+G1QarmvToFhUUpCmPddZOwFacuayZni/zE8koSXBqaHkrNvulMg== 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=F3yR831XJ+Wv3uWKUCy2Pd0J51fkhrB9rLIZIFT3jRc=; b=KCK49CK3OVSGI9rMLraOBSq086mcFgtrcv4XlE79EPZ/hPC00N6IYg9uHyA1prutnwaeco5+YicB4LuvtloR+JqCHjmqvlVT8wE9O9RwzPxeFLTa/Axpzsz4Osp7uCBreRvSyTB36DlMPZswZ9SDY3PlIT7Dx597utbm0vSCPP7FEogSXTgiiQZXNcCMVC48Iddn/6RjvrolgN59fDagp+Q1QEvwyKCbO2RYpHSs/V8OoXwuYJC47ZqwilL9E1VRqtjKEbPD2E+QwVBrJZSKPeImtY1WqC8FPfEof5/jP+npMtQfTOv+4THCRfK93+XR5K8MriZHsRiqHUaSeY8IqA== 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 IA1PR11MB7386.namprd11.prod.outlook.com (2603:10b6:208:422::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Fri, 24 Mar 2023 02:19:20 +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.037; Fri, 24 Mar 2023 02:19:20 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Ni, Ray" Subject: Re: [edk2-devel] [Patch V4 06/21] UefiCpuPkg/CpuPageTableLib: Fix issue when splitting leaf entry Thread-Topic: [edk2-devel] [Patch V4 06/21] UefiCpuPkg/CpuPageTableLib: Fix issue when splitting leaf entry Thread-Index: AQHZXVrixAjE1bwNBkiCoIlm5jI6na8ITJgQgADl+bA= Date: Fri, 24 Mar 2023 02:19:20 +0000 Message-ID: References: <20230323074057.549-1-dun.tan@intel.com> <20230323074057.549-7-dun.tan@intel.com> <174F0C7EF4E09C53.19937@groups.io> In-Reply-To: <174F0C7EF4E09C53.19937@groups.io> 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_|IA1PR11MB7386:EE_ x-ms-office365-filtering-correlation-id: c624d869-320a-4966-6cab-08db2c0e2d89 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: D2jlL1KQM6+tTS+cfOVMoeMGi+2IWeJ+vC4nSOOI5nhbPFlHmePke3IxKPFADlLzHoeSpbly5eCYND2e/+1vNzlSE24SAHmHna96F38utHU5GB5E0rUDQ6zVRlN801587wzs9PzWwSirm5Ftde++DYI+XY5mTuOepfoLEAqUtg35pE5viAukdu04Y1OgLb8ZfsbCumhzSoa7FvVWZpY9f/MM0Zx5MGtSUFjiqjtZY4Eo/yzWrFbRnb07YexwnyYWreOdENpUhrC1NpdNQ2eqPsGW+vqXAg7CPEmopHv5LIbZuV00UmJapdrqjFYjNnW1uybATtHhpT42+WCNQGrGQwgJtELBBkwaFNM8F6JxkKtiJ2gu2rnLDpa9y5ppz2t0MaeTEx2aGJA525Fe27ZTbqN3Fcgr1tv2cwBOJdHEEx6I93BKo+cOKwKBNVCiD2tLi+nk0Mi4/4eyDzqHjCrwnRdNaFNiQJNQTw2jymL2i2VU2fRIHqw1Hq4x9tEWf2/oosOpPGNnS0MbMw3uTzwy4JA+/ke7W4c4LRD9qauHAqphdLs6YEnFvfPTGtHVTCweZNZAnybXhReCHolcc5+GOKAmViUkReP52RugGyu2YhVaSnmoCO9UPE7QwOgXM7s569Yxsdv4DNxibBY6hgwuV0NYI5Rt9bVhNU26OsyLKumjx7IBoKk2J+KFBT0JRzD7CQwbQEpF4vAC1Y7gIb2rWzztyk7swMH8jwRJZqEQeIY= 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)(366004)(39860400002)(376002)(346002)(136003)(396003)(451199018)(33656002)(41300700001)(122000001)(66556008)(66476007)(66446008)(64756008)(8676002)(76116006)(66946007)(52536014)(8936002)(7696005)(966005)(316002)(478600001)(110136005)(5660300002)(2906002)(82960400001)(71200400001)(38070700005)(86362001)(55016003)(38100700002)(186003)(83380400001)(53546011)(9686003)(6506007)(26005)(66899018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UmD4X2w9zh+aUwU/V3SD4gvje2JbE+UhUn8tKfYGOds/Us52DykKBqJZl5to?= =?us-ascii?Q?cxF4amRYRhvIhU5nDbL5p2AqP6tBXQMjyZRSSJCCXYWM6LTVjgxTby4qV6YJ?= =?us-ascii?Q?0/mJEnBCwXIO8QPXlX7QUNeEe04BN/LYppX8xoD0t5CEYi0S9ilQjceF+PRI?= =?us-ascii?Q?RM3xBzHS/lUv6ReLlC2KtLf6NLFPHG97vcIPZ5FRqz4t8mvZViyh0ukf/PBo?= =?us-ascii?Q?nkgkgLgFEQCyGdrVDt0JKzVPMo6ZVf4gADsvx/3XH10Ur90lZ+5SikTHpYuT?= =?us-ascii?Q?9Q5LO6Zt1P5oSyYaddnuYqRqqna++uqC79N29ZZ/7nxiTQ5qFRTCSgBd3oIU?= =?us-ascii?Q?DX2DI+CHp7jcQmLJZNTvUbLcgiXlkYpZD5m5FsXO/gP/kAlgBClpJ44gWzTH?= =?us-ascii?Q?yh+d4L/xdwFxoxVUNkjUG3YkyBklyMGyf/jnK7ZTu85I/6XE5Tx2GZ2oaGCl?= =?us-ascii?Q?/RtHwRHuLi58GBDpoHn9i64KYhV75QkCJ54CjzYmsldKVyBU253EtIovKmso?= =?us-ascii?Q?RGTqz2GJSc1V4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?us-ascii?Q?M7m5t4eTL2p6rEzSHc1T2341dHfZii31GO1gkKl8ZRsUmr2lSe1s8GXHchi3?= =?us-ascii?Q?LrpXHo0uE3B83o3PVKg7CTDdIgqHUTFnn3FKnI7pAC8a8mXjQqd68rILSF4J?= =?us-ascii?Q?Em5fMheYeX61cvKz+Ow=3D?= 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: c624d869-320a-4966-6cab-08db2c0e2d89 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Mar 2023 02:19:20.8046 (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: yy46XVF+wigB9/2jsQk6wA8rCnGPoWTuC9aOuhqzOvDP0cmVtyJ3hFP3eSH8so8F7/tCZTl00CKIg0cqnybAyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB7386 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 Non-leaf entry doesn't have PAT bit. So "& (~IA32_PE_BASE_ADDRESS_MASK_40)" is to make sure PAT bit in the origi= nal big-leaf entry is not assigned to the corresponding bit (bit 12) in non-leaf entry. Can you please add comments to explain why? With that, Reviewed-by: Ray Ni > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Thursday, March 23, 2023 8:35 PM > To: Tan, Dun ; devel@edk2.groups.io > Cc: Dong, Eric ; Kumar, Rahul R > ; Gerd Hoffmann > Subject: Re: [edk2-devel] [Patch V4 06/21] UefiCpuPkg/CpuPageTableLib: Fi= x > issue when splitting leaf entry >=20 > > + ParentPagingEntry->Uint64 =3D ((UINTN)(VOID *)PagingEntry) | > > (ParentPagingEntry->Uint64 & (~IA32_PE_BASE_ADDRESS_MASK_40)); >=20 > In this branch, ParentPagingEntry is a leaf entry covering 2M or 1G physi= cal > address range. > Then, why not use IA32_PE_BASE_ADDRESS_MASK_39? Because for the two > types leaf entry, address > only occupies 39 bits, not 40bits. >=20 >=20 >=20 >=20 >=20