From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.13518.1676033556970649360 for ; Fri, 10 Feb 2023 04:52:37 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=kqKvNCX9; spf=pass (domain: intel.com, ip: 134.134.136.24, 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=1676033556; x=1707569556; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1cNJpB4HfGzPCDzNk/Ynbl/WttSC9f60Todl9uJSa6Y=; b=kqKvNCX9prgZcOB0l1BwFEbmm0fzcRlXE57YXC+3KdVnWeJFg0yVAhVY H2KvJhP5BLZ8xE+fSL1utNCLlPpFMb/n72Ihy7s56zzDPxrJlG0ixaiIk AMXqMS+A6g6lJEDIB+hqIcn65johi+j2RUnAIWS1b12zq0gILaI2VzrdJ BWHqsxpB66TEpyHkJeHKxSpKPOU2WfBZDx1XlhEmytOQct25B8vKqsa7Q BlDBPxDQVafuSAgHzqPe7qL9eo9VpRxHUv5pQCxck2OqnTQmFscd4PoHL z/CTc9QQh0GUXOhBXj6Op5IXjZi9ZCOXMhW5PI0Q2JsYHfVriVhmyb4XJ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="331716815" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="331716815" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2023 04:52:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="698416804" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="698416804" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP; 10 Feb 2023 04:52:36 -0800 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.16; Fri, 10 Feb 2023 04:52:35 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.16 via Frontend Transport; Fri, 10 Feb 2023 04:52:35 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 10 Feb 2023 04:52:35 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=johT0o5enz/+BABC8wbciwi29DDPgSTGg+aWwqL7jHChp3h2HNgvhS8XzZH/iK+QTSnJNBbMxCuCvxzXeXcSXZY1Frvf0YSFetOdFLFzhU/y77xR20q0E1XFqZDzh51UFHnkpq6bk+nRIpKClHk4xZZfbCVQpZSgqlhfugnudtOBoiVG+tELu6j3t8CGjmTaZXVEP7Qw3G/a3Ryy8kxoC4ykSnkK6eSRjLhS2BEfdd/j4Orjcw2vbl6FvMqmvBmuXo6bB6HhqEHRr7a6Az0hIlo3piCERj/hJeR0LKgX+ybR1VOEut/ZlgPDLjZ+QL3YkBhDh/AQ3l8J0JGwoLR9gg== 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=MBudWqGRyX6IXEjxXrZ24/Gq3evZ5fQ8HKQbhK9End8=; b=ZOa+BRftCRLHC0s65NMmrdn1jLnj76A0Y+d40yOesb9ljNSDwuX8fPemx5CcdLWZmWBGZZzPyEMO7GCK6j1VVTJNrWcRTbZn4Eg1DjXCGxn8D+S7/9TMAsEyLxfYWF/lGrPCYIoHxtoC0JB+FgILvY1Ufn7TYMt/uPcXGK25GQ41pmDNItlmzjzZh1ndEVyruBQIitrV11D6k7056uLj6+09ko3Z5RjgSmFhCflP6i/NqukSMdEoK5oUOHluk5DKPdsZBNsU3+/U5FSSSSQqqR9aYx/la9n3+B2Kyuh+RbIPzCIIzNewS62hw0xwI+Bw+ize2/0myyp/36FEPqXKzQ== 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 SA1PR11MB6782.namprd11.prod.outlook.com (2603:10b6:806:25e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 12:52:34 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::f890:e4ec:e2d8:5831]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::f890:e4ec:e2d8:5831%3]) with mapi id 15.20.6086.017; Fri, 10 Feb 2023 12:52:33 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "kraxel@redhat.com" , "Xie, Yuanhao" CC: "Dong, Guo" , "Rhodes, Sean" , "Lu, James" , "Guo, Gua" , "Tom Lendacky" Subject: Re: [edk2-devel] [PATCH 2/5] UefiCpuPkg: Contiguous memory allocation and code clean-up. Thread-Topic: [edk2-devel] [PATCH 2/5] UefiCpuPkg: Contiguous memory allocation and code clean-up. Thread-Index: AQHZOvsY5sUcsC19BkmxVJTXDpsRga7E5a6AgAMD3ACAACDdAIAAG1iQ Date: Fri, 10 Feb 2023 12:52:32 +0000 Message-ID: References: <20230207134939.273-1-yuanhao.xie@intel.com> <20230207134939.273-3-yuanhao.xie@intel.com> <20230208110933.bho5lybb6evnqcoh@sirius.home.kraxel.org> <20230210110946.qgxzu3rs77wgltno@sirius.home.kraxel.org> In-Reply-To: <20230210110946.qgxzu3rs77wgltno@sirius.home.kraxel.org> 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_|SA1PR11MB6782:EE_ x-ms-office365-filtering-correlation-id: aee87fcb-68fc-48f0-6235-08db0b65ad4e x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hDa7Vvvndujpq5CTxg07/vfdZKqdulTyfbSM8uoXOYlsIdNng6Blmkcgkp+r/VNCoQ1zwm93NzYwBDjXSCMyQuIigxdenTTHaDI5LBjk3bn2PsBsPFoJUwpnbouoiNqHUk3dRgNHobBor7nvPeRE02on+QI9PoFw2mSlEoJ9BobkGfG5BkC+kMhB71sUBy697+r1RfEx3/vWXuRaGw4AO3Jed/uuN5s4jTwrWVJmMD0f1RYwnApusgq5412uaw1LHUvvlHnqNvPceSa1ahS3qtCnH4CIQpjJutqLsnR+a/IR+LyJI1XGb0urtI3OHibINHiU2PgIXtg8KRE5dM3I2hMYgbRsyEEeF8OW+77zacg/KipvAQds4xnTeL4dRIEAjyZ6uDK3j8Cw9Oq6ROAxLOmMzL8z5cq3/8mIgU1MO6KOnxfOfGtEmEAcP9hSKeZOhPTNSj/LhKWOgf4XKnSKB0/qIaznMqvo/w6/gpIHSRxn2gOxcIKQYvI3l28jB/OPS8jd0e4hjhxs0r3LSONQTC/4tMk5wazKuFlRhHnsT5HgkH5A3QwzcgM/LFAwOd1CL+uAYKegE13VN8El9T4GI8JJEKMZiEjm9TPpc3ye5ej/+LbDZJKjIwrb0SFctMqKdsRHEhzgfh0D8wjfkjvzMEWXjyiw5qcfPGDPNpapEGij+GgeYr3cT7dZOsmO+hp4ZgfG5pl/E3VCTNxjuqfG1A== 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)(396003)(136003)(451199018)(33656002)(55016003)(83380400001)(82960400001)(38100700002)(186003)(9686003)(6506007)(54906003)(71200400001)(478600001)(2906002)(26005)(6636002)(316002)(7696005)(38070700005)(41300700001)(8936002)(5660300002)(122000001)(86362001)(66946007)(66556008)(76116006)(4326008)(66446008)(8676002)(64756008)(110136005)(66476007)(52536014)(4744005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?26PXuUJ2W98mKOCOEJXtXdlQ2Qahj2IpnSE5JqCWYt4DA/rH29uCMtGiOTYs?= =?us-ascii?Q?Y20BqgNAGjCUkrBp1ULf377g8HwOop601Cmqrd1j4OPXlVsdmOhIsHteKCOl?= =?us-ascii?Q?GayuegZuvdHLhypFttplp8GANhrUXleMU4zOgNaX4sEySOs8bbMhgD7I9Zsz?= =?us-ascii?Q?cKflwJnF0RJZZXw6vGY+FYP6s2HBkre4V5V6eo0+OvqSEkjTKhoU/F/2oUkg?= =?us-ascii?Q?XNfKeGWn63qjl5uvRPRbAc/B4eCbMz3D+ezNl+gtkDeoN/KLGguzyq8e+Xuh?= =?us-ascii?Q?fUQAw9nB3LZfvUjAmdxh4abeP9ch6S8msSm5HldwSs/P7PuZ8xdb4/ftPown?= =?us-ascii?Q?goUlhC+/sfLCtHAFP2farjxHqh9M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rut2C1yERvKQbR2d20QJJHS/mWloZ5SwMOnq1YevG+4fM6g?= =?us-ascii?Q?3CROMAR9a9qjLTUe7wuCfGrprWBSmt+D9gFbG+GutNtt99KmIjIT4ibNcGUW?= =?us-ascii?Q?pWPmEfW+tp4yCRfGYF4FyGGBfyVd0Kvp1OQlhflgEFmaHU5owmXqTa3DkyzH?= =?us-ascii?Q?9xxepTPShJfjIgwBHWDzaI0+htuvVpbHDweKaZy2LdAVfQqBs7m8q8SYRe5v?= =?us-ascii?Q?j09Ibv9B20ZWRBbIzTZ1RSL6S2bXr10Gvjxnflm9mQtH5ZQlWGdHb6JdZ/Nl?= =?us-ascii?Q?y4Gjc6RFhxipILxmsZxlPIQeGQtu3tuPBWVh5V7p?= 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: aee87fcb-68fc-48f0-6235-08db0b65ad4e X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2023 12:52:32.9630 (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: oXsW4+YFRyAazXuXuMYEEjrsM9tfHkXmgF/oXug9xKKsSyU9F47Go8QvSNN86vH3ylv1UtDGgdTBBpjgNm2z8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6782 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 >=20 > Hi, >=20 > > 3) The special case you have to handle is not running on a AMD > > Processor, but AmdSev being active (i.e. UseSevEsAPMethod =3D=3D True). > > Otherwise it should be just standard Ia32 and X64, there should be no > > need to check whenever you are running on a AMD processor. > > > > I understand your point, but for both cases (check AmdSev, standard > > Ia32 and X64), AMD related code will be changed. We would like to keep > > the original implementation as much as possible. >=20 > Well, the original implementation never checks for an AMD Processor, it > only checks whenever SEV-ES is active (and sets UseSevEsAPMethod in that > case). So why you are adding that check? Gerd, I understand that the patch tries to keep AMD flow as the original to avoid breaking in AMD environment, no matter with or without SEV-ES. Yuanhao, I suggest you work with Tom later in a separate patch to put AMD64 non-SEV = CPU in 64bit paging mode as well, if Tom can help to test. Thanks, Ray