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.11565.1683708150368790066 for ; Wed, 10 May 2023 01:42:30 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=KGvdQyyP; 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=1683708150; x=1715244150; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=dk3+MbLyqA+tIDHsdNV/KQT31X4TzSkDfClSVXlHsys=; b=KGvdQyyPqU76dQELQA6OZkT4OLuPMzKjHAktrxNELmqxpYAeuUmWn+3d Z2kvtxhBNMwe9UxG+hAwkTo1xtnfFYbBpTw/dFHzcmZQE/j2JOZbvrGzW 2QEyYfLOzoZC2KY86NkVAaU2yc3z4EGBuBCbElqjwhaoaL/vKRQnC2XpP Yrf4ODQUkfp3XnF2xkezZETQrcMceXNPBuvOjUsQO7QEE7p6260cMku0i lC9hHOzwUi6ljlmnW3xbWIfb5HWoOtFBtlE0N9hZpFU1B5KSOgNhm5TZY 7tMdbzMdj8HfkYP4vxe4Qp0jtKg+PFXgz+CATsmuOy9bekBUo/740gkg7 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10705"; a="352351178" X-IronPort-AV: E=Sophos;i="5.99,264,1677571200"; d="scan'208";a="352351178" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2023 01:42:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10705"; a="702181802" X-IronPort-AV: E=Sophos;i="5.99,264,1677571200"; d="scan'208";a="702181802" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 10 May 2023 01:42:29 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 10 May 2023 01:42:29 -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; Wed, 10 May 2023 01:42:29 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.46) 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; Wed, 10 May 2023 01:42:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dzub1jdLnLVhAWhXZBAsthFZgOjkJpBxk+rig4Bt2CO/iBSr32eRuwCpHJH7jTjWhN2VIjhfspvvf4Mlju+LXERpNCz8UGUwwRmTSX8fct0jYDlFeIsz/Apy7TDNPQQtMnFrYmb9FBivORea7BVZCD8kJxvDhiS3C30L57DyfYzGO6xnYQGIuzq1hsDKBG6GM/ukLIbYFj27mFD8p2ZuM6KJn8j9764ftRAkjkq8GxSoD4vH4KpO1DW2qcsgyIdBHTwI61kZyB/KIg3nnKHInXOZalCUBFqruyfMRRb+2qkI8YFu6hvv4kUEGOVRZxQ0dRmFhnCIAcyawhHvnLqbZg== 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=QobuqF7Ctao9K7lUa3UJMFT4kzb7hhAneEXmvS7lsjo=; b=MR/EE+U2mn4NJWsTteaCQIBkYAzBdQrWIrmkATjHt9Gcmyd/ybTISmWJiG8ljyXnK6MONKBPRWToh8Vz4D+7AsPGb1hRPEmlN9UMIYQd+w/p9vzpChdNO6F7xCa+VylGOlgPdwK+ajXJR4UhKyKzWolE4+v0S0OraKJDpv6QXbirVubmZ1mvoz/2ZlWST5iVJoyvKiqInQ+LzI49wfP73L3aF3G/Eg797k2XfutGW/jTEiyPBboawOFFa3Q4Q6k9XE+JHQQNK98r27IV3Vcc4WofoaIDklVBGTiewvl6qp2gquxYi5R7XF09l7phLhPS1V5HwJDBrbuTOmYN9hep4Q== 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 CH0PR11MB5443.namprd11.prod.outlook.com (2603:10b6:610:d2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Wed, 10 May 2023 08:42:26 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d%5]) with mapi id 15.20.6363.032; Wed, 10 May 2023 08:42:26 +0000 From: "Ni, Ray" To: "Li, Zhihao" , "devel@edk2.groups.io" CC: "Dong, Eric" Subject: Re: [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous() Thread-Topic: [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous() Thread-Index: AQHZgxrBo8zoI+XVS0inIHB7SfSBha9TMHjQ Date: Wed, 10 May 2023 08:42:26 +0000 Message-ID: References: <20230510083803.564-1-zhihao.li@intel.com> In-Reply-To: <20230510083803.564-1-zhihao.li@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_|CH0PR11MB5443:EE_ x-ms-office365-filtering-correlation-id: 8dc710ff-ec95-4522-6051-08db51327b3a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HMypB1IDvfgVojtuelQWr/47d06R7hMkmj2ODGzezW2XvCYzL5Wz7sdB1yKlTlmyddd3QarAQlVa3fGXJueQygtGscOa59EhjBsbQ+LPpQAOrUVv3yExA52638kFm4EjClkKr8ovEkOr5g/T2RNjQ67i7mghFxjkC2UYTz/Vma3wJ6k4KNNph0MdQBb+MHAEqcH0RDxYDBBwm+C/WBknCh3MOdu34rlzxNfQ4xVCdaHCNHQVqzPajpszzsj/ZC5705EGBxy4K9XF9xW8L8zKbF6NqvfyjJMfESjNwDqHGc2fvquCLf06FvqOG5CcadAZpzVyf7XyfjHwxatNjVPwnXl0TH0PCneq5BwJIXiWxk0OITXyOcDK7Fk9uOoC9VYoJrtRwMNkbzRu/N0aOaEa3h4glAt/4aKiWz2mOWnKxjnR4m6mwQDCzmXjdBft5db/46egY2dfsDOfyJEjTz8En9NKutEzOazNUwkWTki3Dz2QiQCpWPn1m+H78RKdy1FLHE8tVsOHFubSUGyaRMcX+phnCB/Kyx/IQl9ujN4x39kOpOnKs0EQv/HcaQvO+dcummCRmWc2bYm2N5FPWVpBgu2ASzrMGLTXqO00gJYvlx0= 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)(366004)(136003)(396003)(346002)(376002)(39860400002)(451199021)(2906002)(6506007)(53546011)(26005)(9686003)(186003)(55016003)(38070700005)(83380400001)(71200400001)(5660300002)(66946007)(66476007)(66556008)(41300700001)(316002)(66446008)(4326008)(8676002)(8936002)(7696005)(966005)(110136005)(33656002)(76116006)(64756008)(478600001)(86362001)(107886003)(122000001)(38100700002)(52536014)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?a6p+YivFARts970w/OaL1MXeZ1OLoZok2DQcvjPHstJUyKd/r7zCJbiQytZN?= =?us-ascii?Q?OPJ6B0LEoc5J7T656BDE5FSxRGyiZ94q2EesHWo5dzldxlxqAdH+2+UKS1VJ?= =?us-ascii?Q?n3JuNID20vFqqCtYdsWzKe8ghzF3ldwlbJlKeIVvgSw1E0VbQoJVT0R9aU0p?= =?us-ascii?Q?9/lJ++Igrl4fPs3QUib/Tey4Xb6iouzWKoOrzJTMSOTa9F+VC5ikNoPRthmI?= =?us-ascii?Q?9XNNsy7NQEf7im+OMbNw02cW++YNOoCdLlaIQvZO0Tw0RDjyECca9dpsHNDz?= =?us-ascii?Q?GGlNpHhUlBrKb7oou5Oq7OTA0vsLvGSrKG0Q4I0x1H0sW4TNk6oANVBNMTgJ?= =?us-ascii?Q?DuxB+GZgljVBb8Jmm7wcoWLTYHz9NztbbzJghy0hTT3XE69mi0Ptr5aVVrdR?= =?us-ascii?Q?SMHbaUI5m6kTb2QjJyWuFJ0fb5mumcQKuvxi9KzAfZIt8io5EBCWEXAWlVeM?= =?us-ascii?Q?J/aYBkYhRErweTQPzCfYGmT1n00mqNDWYwLkn9fw5EZgnteiCNsvqb1k3MK9?= =?us-ascii?Q?G5pNYCwXI5FtAGNxykI/G/v0BzOBnK5O/oczH69rKZMyBXqhydoOWx7qht7y?= =?us-ascii?Q?n8uVq93VJm4HYDH5LiqcP+r3CPOb/Cmn/mmBd4UMk7JnJ2orraKzTRoxscDW?= =?us-ascii?Q?6TFPgp6AjZ2miRV3yAyhhCyH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=?us-ascii?Q?14qH3Y6G0EdysEptaG4=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: 8dc710ff-ec95-4522-6051-08db51327b3a X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2023 08:42:26.0191 (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: J3PGgWRDdXWZchh1Dy1p4QdcOCV/FJfK+TYHoNQEgqN1Q7Ij5LmgetXErwU9f1NDddPpYlsyOxNerRMsZtQA3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5443 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 Reviewed-by: Ray Ni > -----Original Message----- > From: Li, Zhihao > Sent: Wednesday, May 10, 2023 4:38 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray > Subject: [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in > SmmCpuRendezvous() >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4431 >=20 > In Ap relaxed mode, some SMI handlers should call SmmWaitForApArrival() t= o let > all ap arrive in SmmCpuRendezvous(). But in traditional mode, these SMI > handlers don't need to call SmmWaitForApArrival() again. So it need to be= check > cpu sync mode before calling SmmWaitForApArrival(). >=20 > Cc: Eric Dong > Cc: Ray Ni >=20 > Signed-off-by: Zhihao Li > --- > UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) >=20 > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c > index 2ebf4543c3ed..391b64e9f222 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c > @@ -1,7 +1,7 @@ > /** @file >=20 > Implementation of SMM CPU Services Protocol. >=20 >=20 >=20 > -Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
>=20 > +Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -421,11 +421,18 @@ SmmCpuRendezvous ( > goto ON_EXIT; >=20 > } >=20 >=20 >=20 > - // >=20 > - // There are some APs outside SMM, Wait for all avaiable APs to arrive= . >=20 > - // >=20 > - SmmWaitForApArrival (); >=20 > - Status =3D mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : > EFI_TIMEOUT; >=20 > + if ((mSmmMpSyncData->EffectiveSyncMode !=3D SmmCpuSyncModeTradition) > && !SmmCpuFeaturesNeedConfigureMtrrs ()) { >=20 > + // >=20 > + // There are some APs outside SMM, Wait for all avaiable APs to arri= ve. >=20 > + // >=20 > + SmmWaitForApArrival (); >=20 > + Status =3D mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : > EFI_TIMEOUT; >=20 > + } else { >=20 > + // >=20 > + // BSP has already waitted for APs to arrive SMM if SmmCpuSyncMode > selected or need config MTRR. >=20 > + // >=20 > + Status =3D EFI_TIMEOUT; >=20 > + } >=20 >=20 >=20 > ON_EXIT: >=20 > if (!mSmmMpSyncData->AllApArrivedWithException) { >=20 > -- > 2.26.2.windows.1