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.web08.21881.1661419116491820873 for ; Thu, 25 Aug 2022 02:18:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=e82c5buO; 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=1661419116; x=1692955116; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=0+oe0kfwAYN+Hr0GAHVpCNApZhmV//H+SzNS7BSKkoY=; b=e82c5buOcQwCpvllSajIgYVInKl/7XK8DhuuUf+ydN+gIW5fJWl98iI2 FU2qxvwMoufIcvKmByCKgo7jxcJQoXjLtNMUUxW9izULKsboyWGgcsgdb vpqPdKb27b9+hayHW627SVX4djaxjIH3tb7qzaCdZLGqs/FsYqYZhmzrp BtONiEWGybI9ceeyAyq4fxJg5a1ETY4pKFEfhns7c37dw4J/DyoWHfCjf 1cGkiZI23sZKadt2go+syR9ob8sWRTsQsdqw0xbI0PXPj3PZjFekgZX0b 7sDaLjIaNsHt5bnmu6FkTafGWPtEIMDYuHwsENK/XeO9MXnOfjPt4wEF7 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10449"; a="274583676" X-IronPort-AV: E=Sophos;i="5.93,262,1654585200"; d="scan'208";a="274583676" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 02:18:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,262,1654585200"; d="scan'208";a="586799966" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 25 Aug 2022 02:18:23 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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.2375.31; Thu, 25 Aug 2022 02:18:22 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 25 Aug 2022 02:18:21 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2375.31 via Frontend Transport; Thu, 25 Aug 2022 02:18:21 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 25 Aug 2022 02:18:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cbwUEWP+7IbGSXMsSrieaG79QVIO7LFQU+9/UzaV14gBAbC5W7huFFUunb4RMHNhOZ+CsDCBKrA6hUL/Fy7Xww+RcdO8kOb/qoeY4yikVPNmQeaxrugrhaX0ddHB9WTyTInr8FbgWle104NDPXzVsmQEhfiXzc190uhPMYKJ02GNEaYSS9N52BRNPnLOz3NkbeYcy4zmwg0CnsKmSKrE0YLHnZg36Mpj8ScYpwuT44Hrx0o/tLQlmqslG/ACty244UQNffovLSCspPdybrdZGVJyqOqAIH3jGFgLLP9NB1R2R83oCaY1f9SQlJfQ8f+B0YDuO/GTOBPSiQiEdEAN5Q== 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=SfBGrXA6ACxFjcTurKwXIy0OX+4yp+hezfiR6ygdOnA=; b=Q7lXb7JJsXHi144XV9EGhBH0zsGDiQy57Mpajl6GgCfctOXzRp8TopSDJAdEnrfuGBW54GCIpRoDyZbMqiKMCTa9R1yhoNTMcpBESP/vbZfBYaRIaBKUE9YBCzf1dCdIerMTWy6188VizJygtgaKR1jpnXZdQOPARuxhhPSWkTHXh2x8lndJNmBRknAWzbZYNO8QDgsc5rwUZWWMwBQdsJN6MogZkil4xCSsBqIiI7U+wR7zb73cIvUCFQdqc7SzNiHwNacDB9tUs+C+Jf9hRt0FBmn+Bz/2rcYxmSkBDZvr2VmSkYPjO2kL/FZmSWXtXUswvAEfJPFohpW2qADPzw== 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 MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by MW3PR11MB4764.namprd11.prod.outlook.com (2603:10b6:303:5a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Thu, 25 Aug 2022 09:18:16 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::958b:cc9d:ac3:288a]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::958b:cc9d:ac3:288a%10]) with mapi id 15.20.5566.015; Thu, 25 Aug 2022 09:18:16 +0000 From: "Ni, Ray" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" Subject: Re: [PATCH] UefiCpuPkg/MpInitLib: Simplify logic in SwitchBsp Thread-Topic: [PATCH] UefiCpuPkg/MpInitLib: Simplify logic in SwitchBsp Thread-Index: AQHYuC4lNSu/36L9GUiZM6jqw7aWEa2/Vivw Date: Thu, 25 Aug 2022 09:18:16 +0000 Message-ID: References: <20220825025506.2323-1-zhiguang.liu@intel.com> <20220825025506.2323-3-zhiguang.liu@intel.com> In-Reply-To: <20220825025506.2323-3-zhiguang.liu@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-office365-filtering-correlation-id: 38384909-7b50-43b4-f471-08da867abe9e x-ms-traffictypediagnostic: MW3PR11MB4764:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ak3SEn1Z279nGG+Q9RJcwqrPZsMJEjpv36E/HG+3jL2dN632lTacqsS3gOvYtbGjbB0JfDA0BGP99cxPtVpQC79f3qDsqvScsY45jrr+KgCkDAUU+7TB3WKpaPH1lVz8bDs5F6GQ8k/nBv277o3l14rqJJIhEZRuL75vkG/nNpoT3yGFcmjcLsI42MkBn6FiuYQ7dtHd9aAYwuOJjXfaYsAOLOB3+wXND4tqCg8YnQRMDMeMXgWcwDPlBDeXLCPKoyU5RC94VaAPOnTRfEXRiAuOewpvmFZhdt7FjenFA2ATTYxv3gZc7yAwg6wZ7wVQGnKfpe1wlHS2qWSR5OEy5cvKwDz4HITWMmxE3vgrBnNi0V1ONz0N8kLjf50tKrUu8w3GskcJiIaJXiT/Hq3nR6axwj5NT8aIeaS6SUhW6aFlQTKXU+UeNDh3gkbAPG+R09qgA+a+QzIEQgEJL6R+Pyfmjl6WxN+4eCY1PrFamnwvAp6rA94V54KXumeXJ4bdzx9x86w9l9zSduDYp4fzJaMpOM07wGbnht7/FI0BqjzRG3ERYIHh0/qXLsu+BQeGvwQwrrBE8uVo2IVptS9C6HoCHc7qvC1joZ8WlJRd4YtsQ6JCj9mvCs8zzXkSApQ4XjSZispcqQHh/vEzMJ2pFcpEyUIwJf+Hl5T8g6WRRxFl6KD0n9Xt5sjuAdpfKMgKWZUNcLV2Nggep7n4f9BvsVQe8qbauWOYMg43P5R6X+eTL46QzEHIXBN3IKK4vyzm05JoxI+Ln/87mzg6uqqxFiyDMjPO3yYl+nSVVRcTbq0= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(6029001)(396003)(376002)(346002)(366004)(136003)(39860400002)(71200400001)(478600001)(5660300002)(52536014)(38100700002)(55016003)(4326008)(76116006)(8676002)(64756008)(66446008)(66476007)(66556008)(66946007)(122000001)(107886003)(110136005)(54906003)(316002)(8936002)(41300700001)(26005)(7696005)(6506007)(9686003)(2906002)(186003)(33656002)(83380400001)(86362001)(38070700005)(558084003)(82960400001)(156123004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6AQSGW4K5pIFu88VnJPEJDplSG3qIyV75JT/LkykmpdX6QQ8zp7TOuor1fJe?= =?us-ascii?Q?EkVTyJ93B/sthZQuJQxycNwCP/so6QQ/g0yKO87c72Oz9L8y9MNsfvWfqNFx?= =?us-ascii?Q?bK88aUNAXAfrDJWtAtRL63hZ3AEnXuYe0/zUIopWD4UHdKXwOflurR3I8DpL?= =?us-ascii?Q?Y4g2eGnN6uULLmEZVWOIfiZyD1VveTjDnbjba0+yzwge4cyegtswyvueoP9J?= =?us-ascii?Q?sV35Ur+37DHVy2ietzSd+c5Ag6i1WvJYYazCRlxQJjIV+BBc4JgEzz88qa9i?= =?us-ascii?Q?Z4n8J2HgdGFprB6C8mGIgpsJxQqWfwsTmkmGiT86DP5q/D2mA3FOD/Glbfim?= =?us-ascii?Q?yl71m0JqthtIg+/qlUmO58YoVWdgC0i1rmFOTF8kcnH5jKg3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H57UjpMWu45DO2KoU1ZBcjZk1VoQYiXJguIyPFJ0fLZfF6DP?= =?us-ascii?Q?UumG6mL6lZCVNc/5aLf8Nn8RusMfcgnjXtKGnerSYk3OImDe1rqkjRSUPBIF?= =?us-ascii?Q?KuNU8uZsPAfhXmKtGl4HGPQWt+viDq1I/q5GYEsjYoZsF2bTD7HlMOod8T5w?= =?us-ascii?Q?2v64nuM6oY4P1fQIqILnP0J/WnMrzeoup2ztsT8BjNSHEsyDwPqMV9ccFe8u?= =?us-ascii?Q?HRajQiSyMa5fvT7/PTzF1IJ8Q7adtpVMtVbLI2/zQFpcpdo127JupLFfX2Oq?= =?us-ascii?Q?YYKpzUYmBMuYdJ9jVxrp7pAf+KG38CsqP0lAl6CT?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38384909-7b50-43b4-f471-08da867abe9e X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2022 09:18:16.7941 (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: 7mCbWjhmtYbslCnWngqBoYcnjD/sWSXxNKOaIWJg79zrJ50JTBXtyPXCkhQ+MjbfqqE9ka4YhnqsHThhE4cKEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4764 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 > ;Store EFLAGS, GDTR and IDTR register to stack > pushfd Can you update the comments? > - mov eax, cr4 > - push eax ; push cr4 firstly > - mov eax, cr0 > - push eax > - > - sgdt [esi + CPU_EXCHANGE_ROLE_INFO.Gdtr] > - sidt [esi + CPU_EXCHANGE_ROLE_INFO.Idtr] >=20 > =20