From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.4820.1685678092092012075 for ; Thu, 01 Jun 2023 20:54:52 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Clw/C+V2; spf=pass (domain: intel.com, ip: 134.134.136.100, 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=1685678092; x=1717214092; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=9sMXxHsc5AiZ2AuJpyHxbzVtnM6tnleih+Y4Dp1bwjI=; b=Clw/C+V2kcm7PiWJHyjno8D1IKjxL8VCFoOnnq10mKUlCb3tT68bzHSn /0vffHu/nj066GYwGsdjvxcgPwHhN+cSOJpIxfnqEYAd3CBZRHp2D9BbR sjriQoT5wapnGg4LjSYyvPFc3ZsyI7LwmS4WknAYYhZtFDDX+uJvzWMTC f87GxQfMkqN9NedqPV/C9/iOHSai+aGLvpv/Kgt7UyvV61oPKDzg+AGPo GAWQz5im6Rcg1JEaLudUjDS+oCYwotZm7uRGXgknMKF1eeNx63fcaCKcB 7pUrKJpR09JyZAKBKrE6aon4+s/79iRVq2JuKvaHVcUzUl24nyFhjmECi g==; X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="421579450" X-IronPort-AV: E=Sophos;i="6.00,211,1681196400"; d="scan'208";a="421579450" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 20:54:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="777482968" X-IronPort-AV: E=Sophos;i="6.00,211,1681196400"; d="scan'208";a="777482968" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga004.fm.intel.com with ESMTP; 01 Jun 2023 20:54:51 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 1 Jun 2023 20:54:50 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.23; Thu, 1 Jun 2023 20:54:50 -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.23 via Frontend Transport; Thu, 1 Jun 2023 20:54:50 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.47) 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.23; Thu, 1 Jun 2023 20:54:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A3mHP83FYivIp17ihV9Z57IczZeGeGf/fnA4O8nrVC6XzZEIBANRwt/ks6aNVlHnTJMNvmaQ1Cx8bnCQCg7ODWKbwIqaDT6yDVcoSqeswsve9j+giACeZ0zeum7TidPK+BMpKtLrALoaREmzHEJP0ajGNgVaTFwIm/3kh29KhaWWwU4sU3FUT+dV1J4apOic8cMSsnJiWDLacETiCr4LKeMX/KP3FpSwLLNY4dxikWvKRUOiQ0kaVSEWFr1XJrPmQGowzWgcDVNWmOpdTvre0EyQfENr+O5UdmNA7kAcpnOuYHsQiqyLSXV/xJ8IzAjVNO+XhHsNCxKgM+1R9qC8TQ== 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=iFGg1ecSRPdid3Guwfbp+P/lly9t5/nepE7CEt9xVxI=; b=jowCxPICkbwg0HfnKWnHcTTRFtaSzJSYfObpc45nZanj167J7X4V1d9UPQcwJsNT45Sbz/96iKdWoVSDuvlOLcGy4ZK/Ka8kgbUuFNmWtrS5p4Q2xetG1gefkpAZ6PFqYj4hisF3xRT7U1hyGzc9rTKzVOrFP0cGKDEKjrHp+T8J8KIHY9c2R5FrjNttiAwxLpFU4GqtbNsH4uz7uD+i+5PPyOgBwhguhW/ksreBz81FG9T1H42xIEZaEQjGwi/lY2uWy1SRrIloLYLdEEL0j4JX5fMNzbvJTRyZMPR4efz/K3acyIYYI8G+MjJ0+lUhyYY2nCt8SOUnk9Akt1mS5Q== 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 PH8PR11MB7096.namprd11.prod.outlook.com (2603:10b6:510:214::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.22; Fri, 2 Jun 2023 03:54:47 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d%3]) with mapi id 15.20.6455.020; Fri, 2 Jun 2023 03:54:47 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Tan, Dun" CC: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann Subject: Re: [edk2-devel] [Patch V4 14/15] UefiCpuPkg: Refinement to smm runtime InitPaging() code Thread-Topic: [edk2-devel] [Patch V4 14/15] UefiCpuPkg: Refinement to smm runtime InitPaging() code Thread-Index: AQHZh91fiEJoYO/AcESqhu+Jd+RVsq92+6qw Date: Fri, 2 Jun 2023 03:54:47 +0000 Message-ID: References: <20230516095932.1525-1-dun.tan@intel.com> <20230516095932.1525-15-dun.tan@intel.com> In-Reply-To: <20230516095932.1525-15-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_|PH8PR11MB7096:EE_ x-ms-office365-filtering-correlation-id: fbb84a03-b47a-4cce-99b2-08db631d1bab x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LOMz71Ze0Vo7cPTkRzHlGsiCAE7OWdS6WDnUrKcy1TqSSItD37ZOmPJ5NaoiKld+NnEL1fZWBIoybbSjzQfAWhQjbK8V1t1Ff2HTFN4NE3t6epDLSngUwN7IlK0HX4WlaknjaIOBkBsgRHrK7ZsAir4tdAwdRnWgz1+mGc03h8eNI6kwEizI50Sk3A1F+jEXVOAKIdNdozfw2BKga1BVy0olcnFRXJv6nYd29DwlsLmvENk1v3X5yRqwKfDfLyLrLUYVaSRh2BnKg0IesvKQBVPXS6J7RtqLqxAfxICl6PXy5XzTxdzjNp0Ot1h1w/Vddqtk20UOxdgtsiR/LWG+mhKx3fsePOutkyG1VE9OPhb4xBtU1Wa6+DYsSEG3cSMQK5ZiCmr7C9GpZ0tx0ShbZH1JsfPAlVy3sk2RJnDbY8SmWDpSAihgmGX53ZGnb9zvzmaMIk4Sceu1AovuzjNe0mo0xFBbSLIC3z3LpoAc9G8FRBvLNW2tqykjJdJWsid2VBdLr9PxPg6MvMJQhq5wyGOMoKKnbZsXBaWysbDVe1tbe62EVaJjwn+FFkxvZvkstW7UomsgRJJZLlUjLWSCZaqkDh95GWSF+6Y27GBPAP2lkRXDTL5ywAEa4JwZAaU4 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:(13230028)(346002)(39860400002)(366004)(396003)(376002)(136003)(451199021)(122000001)(38100700002)(110136005)(86362001)(6636002)(478600001)(4326008)(64756008)(76116006)(66946007)(66556008)(66476007)(66446008)(2906002)(54906003)(4744005)(186003)(7696005)(71200400001)(6506007)(9686003)(316002)(82960400001)(52536014)(5660300002)(26005)(8936002)(55016003)(8676002)(38070700005)(41300700001)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nLnO0fqgLySTcpAsRvu/RU2z89QvlLgSCL02E/V6QFr4BWsi//d7dvCadpxQ?= =?us-ascii?Q?RhREbEMYrPYTfVVpdOZ7Qx4d8YMa9IZxEsON7CzRxFfVOF+59y26DOmp1K0z?= =?us-ascii?Q?lYLQiK9VykQnB2dG6euWPEVPJLW5UsNWPNWYzIVOCOhLEdkiiJZfJh4A/LoC?= =?us-ascii?Q?hccpCF0uzULn2qgspgMkdaZaJp7clRz9SMZkut6xmuqF1vXsoheYlQ3XBdR4?= =?us-ascii?Q?rLKI41HU+QPl53d9QFEDQYhJ5w3Ii1Jmf8t9dvooAeA3Bzf9eEhuPaG+U2kn?= =?us-ascii?Q?IN5PT5XW0a+qjMM+tnZ9l3mcZzYd7PnxNJpRbzQu3jQFcRXrEoyBt5FdzteM?= =?us-ascii?Q?uvN16o3qqn/CDVVFhy74wvTVpa9LHF76x8rz8eseaVGsDjMo0IWk8wHSWngt?= =?us-ascii?Q?LbQrdztsK5NDUKHpLzKPuTOytlloWh+Mt0sJr/CtsKzsskqp+vdiMmqP1Urq?= =?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adwXK5B1A2Bdz7d02i7sB+?= =?us-ascii?Q?OOO584KyHXBbSgi4dgu4dt/k5BNOI3TDqtsuUUZ96m9fymjNEl+duaYCQ5le?= =?us-ascii?Q?wAQ7ohRHe8MQTqT3ijGgepM8V7unBO+fjBRpzl410+okMdWxUQMuPy3G6MZP?= =?us-ascii?Q?/fFLI7nCn9S+1k5IP+hFW1lYu/oUM1mW++m/Yl4OqYsBjRdNUap2oKUaEh/B?= =?us-ascii?Q?+VTTT2PxlUpfZsVu3vo=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: fbb84a03-b47a-4cce-99b2-08db631d1bab X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jun 2023 03:54:47.2136 (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: R4/lZtD5WDRc/uLrZ+ukUm9+Wzt7iiOcnwtNCFkShkcvRiNaEZsMS5qLrt1kg3IHTT0SbX1fDXf2q4OVBBVbdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB7096 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 > + } else { > + MemoryAttrMask =3D EFI_MEMORY_XP; > + for (Index =3D 0; Index < mSmmCpuSmramRangeCount; Index++) { > + Base =3D mSmmCpuSmramRanges[Index].CpuStart; > + if ((Base > PreviousAddress) && mXdSupported) { Is "mXdSupported" check really needed? But you didn't add that check for th= e last remaining range. ConvertMemoryPageAttributes() can handle the case when XD is not supported = by CPU. =20