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.70766.1679574561879104696 for ; Thu, 23 Mar 2023 05:29:21 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=LrneW0HM; 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=1679574561; x=1711110561; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=9tp4EV7CuBc3pE3tNI8Hov26dxKZqAjFYFr3ShhyLho=; b=LrneW0HMARfIKnzDkkTpnqM8waQc5FVQVxE7QqB9rMMHUkn6OQux4tU4 apfD3CyUOOCmLQUdr2JWyGsOxzQPqnooat1QTalsqS/C2jJYIUmiiuiIE kOJCMMR1ugRbuLa61Mgi5oWZfHKjM58k9Uy2KlxY+m/dUbqqnY4MFtu0S Q4ciyDaJ2OWGLocc/zDzSMOlwec7opaN5oSfpPKvTatzYa13unvGWEfS4 PtGep4OHGRgY102PuEtMXMocevCkktN8tjkX7a+9uu1/L7o8N1yzKW+fk uCG/ExjHKjRyhGUqKTQ0GbS9H3bZbZaDVBnfaFHCrA0ESJen0plthcyge g==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="319860220" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="319860220" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 05:29:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="793001444" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="793001444" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 23 Mar 2023 05:29:21 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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 05:29:20 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 05:29:20 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.103) 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 05:29:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DbLtPaR8xqJCmVls0IY6/+6V78nCD3pCMJwS+dr4vyyuNXADm7VRhHEb0paX/dQwK8fBRfvE05UkawPjCqs1Rhwxa0GIxl6gR2NAEj9nnPwlPsGD19NmOCgvVpS5QyGhnYnjFbcEd31i2IlDJUv6SL4lq2HrletBKokVSVjEkeSnTXtJvt4aSuJpqrel3jeELzGifK/986b5Zuy6GOaCxUgmz8oyCm9fBXuQsCN2+fJ0T5lwb5m1PL3VCtxIx+llSpwJkHbN4gOPdvxL2CsdfliOTiZPefusS3Ov18NqcdXstdGuDONW5ecitnFJ9bdighGgrvq2Ivb6Pv7YuW1mRg== 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=I2XiFhB/DUrSzjtS3RpKSqmgE/PRCTjwXf2muicFJ48=; b=eV7HDWEz0LuT+1opmFMzv/DeSkg6eI80Qtr8PPSGAuNekbBQOj6dx4LgrBfWVnE/2yTr0aA03jEGAPCDliTeOneo9Z9+CNzao2lxuryJjf9W30GYL/NSGQwXMLSDH2z7jJAlKhNL+sAZNO6fv76Z/gtncw/zb9T3XsdehUs7Du8pSY9lLn1D3KF9uWcTsddJKfW5sJmpJnXXW7X0zfXAjIq5aCI/4CxG0iy+d2wyk2CEgqaDUKj9mSm84rlfwcCIJDreH0rS9WqNH0qs3aKULEwLT8AVkY3Bd4OcNNYYYw31wNV7jdYgHr5ENvrn3r2LGzWDLF2fhGJmnVkw/hePqg== 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 IA0PR11MB7839.namprd11.prod.outlook.com (2603:10b6:208:408::16) 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 12:29:18 +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 12:29:18 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann Subject: Re: [Patch V4 04/21] UefiCpuPkg/CpuPageTableLib: Fix the non-1:1 mapping issue Thread-Topic: [Patch V4 04/21] UefiCpuPkg/CpuPageTableLib: Fix the non-1:1 mapping issue Thread-Index: AQHZXVrdmGhBokb+ekSyAKw74rAj3a8ISyMA Date: Thu, 23 Mar 2023 12:29:18 +0000 Message-ID: References: <20230323074057.549-1-dun.tan@intel.com> <20230323074057.549-5-dun.tan@intel.com> In-Reply-To: <20230323074057.549-5-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_|IA0PR11MB7839:EE_ x-ms-office365-filtering-correlation-id: cf60bfb3-f3b2-4bbb-6616-08db2b9a3923 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NsNj+Oe9+1F7yL/nUAjq8NE1P5VwKGg8a5UuNniKSXvF6u+ifmSSdc+C6g7PV1Qp1cGSihb3tAFD9vuGHynkMJDKfPh8tG36XyWYbmXcJyEKCsGAApPTVgJzegI/hlys1VGlL27WQZYvAKJEPgTHaeGt1OAVs13XU5L+QpNqhfUZ+sc9Xm0FDuJIsjgXDqTqbnjpoZTd6tDiu2FSC1Cd4w3nqe/EgImhhG3uaUXpW+cc1hXfp3ieHpjRVLCBzu3pgKYx1i7niW/4lSkjLVk29sNvAPiMmc9AkBkOCBbsR1wy7SsHfU7Lz9HWkxx3b1f6J6FUEXpAY2a9vjVCNUL+txkEc4SK3pqsESgHb91T15qsfIGADpKHO2d77E/I2pJgkQI/OChanRKNR8Qwas6og2Kuj/DZalNEZcZP0+GAdbqUwAQvS6FI+GByYwMLTorf30jzklCS4PTctCP63dAPXXA4jtwe/P5gmvCgrTnSVce9XCUj/B7sid7edWS5IrRgIBwhWJEuHSfnSGDMc+Qi4oZDdbtOcdOHcRJLvVg0StMgleqytGM3zrEQRAS4/8wL6b+U0QAIlD60vVNhSbEqvHGGOGKWGQ6juVM8A+P/q20U6y9jX0K1gsqPV4hX1jfzuAihMT3AOoc2ehLW48Wi/3sc+mhYdfvachZOjTQFSxTd+ls2Fxtr2W577T7r3FxvPOIRy0q8roXhTONpbYvIZw== 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)(376002)(346002)(39860400002)(396003)(136003)(451199018)(86362001)(33656002)(82960400001)(38070700005)(122000001)(38100700002)(2906002)(4744005)(41300700001)(66476007)(8676002)(4326008)(66556008)(64756008)(5660300002)(52536014)(66446008)(8936002)(55016003)(66946007)(186003)(9686003)(6506007)(54906003)(478600001)(76116006)(110136005)(316002)(26005)(7696005)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IEQrbjfWa4qobs0osicI/yYryRhHszro0Cvl7njPU0KPne4/aBQtzZeTTjaL?= =?us-ascii?Q?jBR2Nv/1kxvMR75KFz3NrVaUY6gWgFmW9nDKKmJY9xXxHj1LKkTQexFqA4+4?= =?us-ascii?Q?co9fcsvi+ZI/tGeXWYyMahvDVocxqUOAkXwwZWwPwTyh9Imi/I5YwFKAxKzQ?= =?us-ascii?Q?Bld1xvdEecyY0q9e/zcVIZFKkZiWlzyiXgDGN7xRYgFxn11acomvLoB/sidH?= =?us-ascii?Q?We0OXVsPtYiQsmbSRkHp4LBma4JlRxAU16Bx3EkqAWnJsHxLZwtk2V53h0yY?= =?us-ascii?Q?Z9ihQq2z0gQvMt07GIHqPxXBHLdJv6BIrlAiGK8rN6sGIXoveScfI/o7f03f?= =?us-ascii?Q?p2EDTxEfwVbAc8Ej+wg8VEQzHMxg7inIeqlEUZQ67Fmab6hFSv+0b6Kb3j17?= =?us-ascii?Q?A08ewjyYxB2X+b4dM6iB67YNbqWgd9Au9efj/O0bqMuLIod2zyaHogwfUbm6?= =?us-ascii?Q?qOwBRTvj3RaVSGvEKf5/tsCiQdV7SkM4/9v+uNsFDbGxxYKLcqCF7HwTapOc?= =?us-ascii?Q?UbZs7R1i+X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25?= =?us-ascii?Q?xN31DuWuPiIuADJG7nTvr9TODmwJuzBV/QuPrncgwK/e06prayVL76zeOsY7?= =?us-ascii?Q?FVnnN7mIqAgnCdrKpvHz1dyDGsSMdZRnFohlm/V0lCF+HdecHifQR8SIsYzf?= =?us-ascii?Q?xB7nMYu9az3NPkLlRZA=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: cf60bfb3-f3b2-4bbb-6616-08db2b9a3923 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Mar 2023 12:29:18.6480 (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: Se9xjQOpZguKmUfXtqp9JfDXghQ4CzvnyQygkb4zOe49jAFLvkJTs1jMbjoVeFy06fHPQOZLgFDnl0ChKSLkBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7839 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 > + PhysicalAddrInEntry =3D > IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS (&PleBAttribute) + > PagingEntryIndex * RegionLength; Overall logic looks good to me. But above code might fail to build in IA32 build due to UINT32 * UINT64. > + PhysicalAddrInAttr =3D > (IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS (Attribute) + Offset) > & (~RegionMask); > + if (PhysicalAddrInEntry =3D=3D PhysicalAddrInAttr) { > + return RETURN_SUCCESS; > + } > } >=20 > ASSERT (Buffer =3D=3D NULL || *BufferSize >=3D SIZE_4KB); > -- > 2.31.1.windows.1