From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web10.73194.1679579524993885035 for ; Thu, 23 Mar 2023 06:52:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=XpKUV57Z; spf=pass (domain: intel.com, ip: 134.134.136.31, 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=1679579524; x=1711115524; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=lSpTfRaQ1bXVfuOanQGJAUXN/XKj5oFRP2wNwtxLhm8=; b=XpKUV57ZYZMCG+0VpyxmUz/UI+kep61Ovr3iZ5qpV7ycvQT6EqfbkkOx AG3KpePmxol1EediSdrBC95nA4LAc6TdEQ/SaVx0GZPCAh7Tizdl0X/R1 qrZIBGFtqiyfaUFW4vvivtemz5JUDvyjE1645BwB5LeKgxb26v8vplw6P zmoJjAy2UxKVvEBjdzCAZJqDrCa4Io6KrfG3ORKj2VVSKQYbJR/dfeDcT cD7q6Ogtp07ablvC4fnX3bbS/QFU2+rO5N8bqNPjxDRsoM6y8oyqelxLG 03k0Ns3ZJatYA4i1C5c6yhPNWcKarV3ab82sB5TkzoibC/X3+50tYgrvE Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="402069999" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="402069999" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 06:39:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="806255975" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="806255975" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP; 23 Mar 2023 06:39:07 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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 06:39:07 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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 06:39:06 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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 06:39:06 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (192.55.55.70) 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 06:39:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WiXLs5TlndzU56vPD3nQ+JEXo0KWctZvJpQokzXRs9Wi9jMXOQ91up5fr4sKXznNxP4HsnW8ArwNrU1wKpBKZFiHx2hvhZMhKPwaJlSDNQvTlUVKzot3pJqk7/u6BGLz/dNb6ls//IzFJpRMLj4tJlQDHNYA9k9JLFYsEfzMf4AKiLfu/dcg4feDeAliwH3TT761G5HY6DfB9HdsmFE14ioSCwrA5/NxUymlxFm4C7yxrRDpqzczvttPqe1+wHZapYMzJdSzh6ynagm6jCyS9ZLz2dlIEdd7IJB2vQj+cjryAMAgKJ9CGhbfz9Hc41Ydka1WV3djuujvLYVIfzheWA== 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=fV7r8SZFVaCLB10a+TJ8uZsCQcHTztwJ8hd3Cp2c7oA=; b=J8nGovhXKXtsiY0W2mQTHGc48WdcxSNKtIWLx58Z5rVkprRMYc4oE6yiFRegc8IZMeoWH0d8H6chueeTD7Jmi3PRXSu37N1NKf1ngQ9qDLsqIn0lxGj/axH2rRMkhOFbA4PZ7x1OyKs20vsdxSoq4xFmFSQb1SjPcaA3oCYVcmtKgWI8tgL6P4a3YiZrzsI3UPJ4dxvpNyRDKgS3YjvbNKJqaXBBmLYOVNM2ZY1A3Mg0jFwzRoofz7oEkkYDo0EGgu5ELX/vD+cxgdzXif7jrl/VFYez1e7SXTDFAKWyEHJHjeak+PrROqD6nq9FEF4D5wa69w8FtESw8duoVlSRTg== 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 PH7PR11MB6859.namprd11.prod.outlook.com (2603:10b6:510:1ef::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Thu, 23 Mar 2023 13:38:59 +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; Thu, 23 Mar 2023 13:38:59 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann Subject: Re: [Patch V4 19/21] UefiCpuPkg/CpuPageTableLib: Enable PAE paging Thread-Topic: [Patch V4 19/21] UefiCpuPkg/CpuPageTableLib: Enable PAE paging Thread-Index: AQHZXVr5G07mbXcokkeDpeQpNOQZ5K8IXW2g Date: Thu, 23 Mar 2023 13:38:59 +0000 Message-ID: References: <20230323074057.549-1-dun.tan@intel.com> <20230323074057.549-20-dun.tan@intel.com> In-Reply-To: <20230323074057.549-20-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_|PH7PR11MB6859:EE_ x-ms-office365-filtering-correlation-id: 826239c4-85f4-4443-bbe8-08db2ba3f516 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Hz2EJuZdK8H6aWIBVMushHD7qhtyrP/Cz5xuN4tcdbPZArDQUWtXBqht4b+xo01/+OkFpOj8Tvi7ZUhVLfRvM0CO3AMB4kFLuixYqQcDa/kzpotYCer0JTk5S5LYLVtGAGLKA12bmj4CsHRTffxkPsJ7a5cV/yeKluDsJqevkLs/w/1vpJYx+d8x6odxx3FzGJQdcg/QOb2Mi/bXiJGHaoS+sNRnTv1RltEFDB//HyEgodQgCKxdhd3LdXdqMVP3jRc/Cr1VVoE2pEUUMEp/4KsABUYE+9ko9j9/9uOda+9HJRftrA4PsXbCOrGRjRBLqYYlX9y20fn9Y6dZ27E6EtuMel+uoSNmyvMbHbMJl1RuGsmpUxB4mViI2zyL9eC762+SpGsLqOZlzncVE0Em40dmXlV+oR2RiKTeQFLU5XxFoJq2dK6rWH1WJBPbeJe9itSf84/fJlOTLpzqiULPJslJuhBPksETJ2prO78Zp27z863WGpkWq742TCWVoOh5SJcXK1Uh2TMa3pb+Yr9SQ3Onpnu7ZodCYS0rpngP4s8IV9GwoxLegiV482exaJEzTfvsvrxROjxjrZb2wEJSTyY++UIwsWYz6V/ywDSUJJu3nFkEzoEsW3M1v7B63vHVG7+d9VYDTxKmuXZZQ6yyM9GGWhb/7ZutCByX7shCZNxVBJI6wg0wcRa7phZs2HqLIRxo4C8ExWlaMeShp0aZJA== 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)(39860400002)(136003)(376002)(346002)(396003)(366004)(451199018)(66556008)(4326008)(76116006)(66476007)(66446008)(64756008)(8676002)(66946007)(110136005)(316002)(54906003)(5660300002)(122000001)(82960400001)(41300700001)(8936002)(4744005)(52536014)(26005)(6506007)(186003)(9686003)(71200400001)(478600001)(7696005)(33656002)(86362001)(55016003)(38070700005)(38100700002)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AnVfzThULTio7P7IXhuOIgdFdqMz39kvGjhdm8NubztFK0aR7yFs5MkzJP7s?= =?us-ascii?Q?i1yF1pUDQcC9KSSwIo4vUXhAz3488wKeiXCW7ZEDYEhCknYsw9mmeMj7jkzo?= =?us-ascii?Q?LQLc9O3McQi1XBxCZoqxjiZwSTEsYnO6tqE1iefapKWYOIVU6lkJEBVt/LVL?= =?us-ascii?Q?bXbpp+BChqkYXOeVfnkSuut6kffpq4elP+4sHqnCcYeNx2a2T9CdAqt7vyWq?= =?us-ascii?Q?ml3X7ab+kp4gmsXEC0dDg459uwQdpjYO+92NHjjv/ALFoQLq5uTo2gH9il0N?= =?us-ascii?Q?qOaGkHjRftyUFggk9dbrbfDoCTrO/Kjau+JWQelZ3VcdEJKoQs9fcREZSStI?= =?us-ascii?Q?OEvRQQ4DF56+12JTD18YJC/ghMRzeCyaGaKWb5Uw6e887PgaVlSeK8j5FqhV?= =?us-ascii?Q?p0H+wLB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QOQw?= =?us-ascii?Q?UoufzxTLFwOGRa2wTYa+tdJsPTeLD+mozAVZuByjwD3Vq8GhD+X4na1QgW/f?= =?us-ascii?Q?QYLxKSUJ+OjWyo0uCHqCT/jcnefoOsBqX8nNZQ9gf5VPuZCJMx4Rh/hTzBqj?= =?us-ascii?Q?1b8/Bs2G+IRSzWeBVAnsfbAoWJvryLxuw0j4viBDZ1jn9A4M6SeaGCFKF6R6?= =?us-ascii?Q?/N3F7YCrtucv22Q4MuudgybsqUO38K8qLkCup6wnY41rxnZPQL69/k9Hviae?= =?us-ascii?Q?o/aVtnQwa4DRQqBdMpiK7t1yRY3SdJDTlGcFC9jT?= 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: 826239c4-85f4-4443-bbe8-08db2ba3f516 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Mar 2023 13:38:59.4316 (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: 3EfSMUMHHL3/iTOg79FdQYnyJoccavvtCYe5rqsfhUZL8jkEfsnhbeYWdS/sIxlqRq/oKE6jfHz2WX2T33sH2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6859 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 Overall logics look good to me. 2 minor comments. > -#define IA32_PE_BASE_ADDRESS_MASK_40 0xFFFFFFFFFF000ull > -#define IA32_PE_BASE_ADDRESS_MASK_39 0xFFFFFFFFFE000ull > +#define IA32_PE_BASE_ADDRESS_MASK_40 0xFFFFFFFFFF000ull > +#define IA32_PE_BASE_ADDRESS_MASK_39 0xFFFFFFFFFE000ull > +#define IA32_PE_BASE_ADDRESS_MASK_PAE_PDPTE 0xFFFFFFFFFFFE0ull 1. This macro is not used. >=20 > #define REGION_LENGTH(l) LShiftU64 (1, (l) * 9 + 3) >=20 > +#define MAX_PAE_PDPTE_NUM 4 > + > typedef enum { > Pte =3D 1, > Pde =3D 2, > @@ -60,7 +63,8 @@ typedef union { > UINT64 Uint64; > } IA32_PAGE_NON_LEAF_ENTRY; >=20 > -#define IA32_PNLE_PAGE_TABLE_BASE_ADDRESS(pa) ((pa)->Uint64 & > IA32_PE_BASE_ADDRESS_MASK_40) > +#define IA32_PNLE_PAGE_TABLE_BASE_ADDRESS(pa) ((pa)->Uint64 & > IA32_PE_BASE_ADDRESS_MASK_40) > +#define IA32_PAE_PDPTE_PAGE_TABLE_BASE_ADDRESS(pa) ((pa)->Uint64 > & IA32_PE_BASE_ADDRESS_MASK_PAE_PDPTE) 2. this macro is not used.