From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.17446.1685546676044113153 for ; Wed, 31 May 2023 08:24:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=DDk3dcl1; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: jiaxin.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685546676; x=1717082676; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=0yZyeeZsr0RbyMfqv/xvUBafJ84nRnHZVzlnnXd36wE=; b=DDk3dcl1LxfH4tfE+9SCN8kkzIRbrElt1P9z70dOaK1zNAty0wa9vtLZ gR8wHIGxkkS4uxjXnnS4zZnMjrfoNFulQmOaWSLssCamTNLQmIms6fulM v/6GL7FZu3yXiQ7zw9KulbC+6YGkHhLp6q71EyEp2QU7RzEL1tEGGQBYX LpZECnHzoLkSC1uq1Kxku0SmTprD5oyJmMGn7WSYp4VY8BvZj+88abaQK 45khrCdVhDjZ7VEmMZGKjGp7uapEs+PmKvx7MTFbX8WGyUFTdhyIuilmn xFzJKsk9/d2IcdA1ltxw4LfBgyPeAXyA8CSB3qonj67j0emXIwce3P5Yt Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10727"; a="441629144" X-IronPort-AV: E=Sophos;i="6.00,207,1681196400"; d="scan'208";a="441629144" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2023 08:24:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10727"; a="739998000" X-IronPort-AV: E=Sophos;i="6.00,207,1681196400"; d="scan'208";a="739998000" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP; 31 May 2023 08:24:35 -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.23; Wed, 31 May 2023 08:24:27 -0700 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.23 via Frontend Transport; Wed, 31 May 2023 08:24:27 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) 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.23; Wed, 31 May 2023 08:24:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=As/FIC+YUsE+NENPNO5MnoLDDN9mfAcPB0k762ZNU96YgJ1Oz/TOmtJe/UZqatxDgGTOhNdDv02LCh27pOpNkT+cDsTDw5Z0fSZmb/PI4K6zRo1D9JAUGxEyWAXyhY1tSv9sD9a4s7L1pCszexDLvbTnHxXlwbb3mdig/rurEKMjUhf3wFXU2mRms/rixA3BMUcjnZsuSHRfxGVWMEzBaupye33exdb+o3bXThY4rmlaCwu5TkMT/DAG184e36s7ZU3tbp43Za6oR5cBudQey4aUB7+6aYKzimEbhFw7oYV4AA2iaBIsj62c1oIHSh1Cd/8YG3/1QkKwP5w6ckehPg== 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=Nkz7mmqvp8Ndosmr2MTVGCj/rjJej6YyRu/52Ie2WQ8=; b=DoL/AsoiqEzhiPXC6YuI/OxuOu2yuRO97qC/UCztDoxfkX5+fjK//sze4Sj2bcHeJqAyz5+2pVJKO4tX+19B55ql4xWD5+VK9k3rf1HhLiXYaiSo0+o72/DhS1vSS8s4s0k8vUrFA0ppu0lTXS44QYoaaQCKb3rnOAzDBfr1TeZEdzzu0nmOnnXkzzyk2fYv0lrfa3Zx8UpFtGmW2hd2l92Gfm/KMsQO4xY41KvO5cqDCszya2aY3DxA6CwB425vRssXFfjAQa0s1/jKqC5PRDABP6bQAIRWMkJDFg0r1L4mnmqpAoPROy/gypcBUWY+mQnO/j8KKL7ZvOHfrjYGJw== 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 MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by CO1PR11MB4916.namprd11.prod.outlook.com (2603:10b6:303:9c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.22; Wed, 31 May 2023 15:24:25 +0000 Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::647e:54e0:2be7:9d02]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::647e:54e0:2be7:9d02%2]) with mapi id 15.20.6433.022; Wed, 31 May 2023 15:24:24 +0000 From: "Wu, Jiaxin" To: "devel@edk2.groups.io" , "Ni, Ray" , "Li, Zhihao" CC: "Dong, Eric" Subject: Re: [edk2-devel] [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous() Thread-Topic: [edk2-devel] [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check cpu sync mode in SmmCpuRendezvous() Thread-Index: AQHZgxrIItVJL/XKw0+U/YrC7n+ODK9TMHsAgCFxKRA= Date: Wed, 31 May 2023 15:24:24 +0000 Message-ID: References: <20230510083803.564-1-zhihao.li@intel.com> In-Reply-To: Accept-Language: zh-CN, 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: MN0PR11MB6158:EE_|CO1PR11MB4916:EE_ x-ms-office365-filtering-correlation-id: 58ce6be7-1e24-464c-b1b7-08db61eb1dce x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qTiBiyTVfO1UuKnEWliZyNu++1Jh5CLR1mLpWCCnxu5T+kghkwKa8p/ui027Na+IZ2rNlfH95oASqVBhNYQd/OmF3aYP7wN55u1dGtXK5BIPM3xyaEiGWiDPtQCHyYS2k3fFtv5R+oo8bIlCz2Xrtv6gOh+fjeexQGZw3PIJ9Yhuwn3EbgD6MHYAum8YbWOrKUUSAHhn0dwwRDBQHfBb5W7BAoXlym3IUIu5rxyiEEOFS4lJH2Gxav6sihbO4efHIDPIp/3GYnhKoksOXxvuV68k2NCJKvT9X6bQsmoEqZDKxCgRKDoSx8R9dWLeGmKXQVSn9Nj9mmSFm+gacsiTyGl7AqIlaQBKOOF9eZwF8UHJrtOxngcvCpkLLMunK1mKOcRkuTYl1zNftNhQt7+2veDAkVSHx+ZzHJsTJvhAvu+yuQD40YDfZMhsgXKqYtIXFQMQZljE6FwXxz5uQFX+g8AwUsI+1qytMzakACuvUujqNAYPdKPCIsE8oO9reG5cb7LGJHybi0TueYu5xDlnRvlEqPMEpn83Zp92v6IPoTYui0anI7KwpywS9kmcg4SVXio72Xylv1nPIcSi6dySJvDmuU7rM8X+IVl98tW1X+H/RtJRssiaetJmY0smqHQjbLuSrIf8YHHfoTF6Pp2rgA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6158.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(39860400002)(366004)(136003)(346002)(396003)(451199021)(122000001)(71200400001)(82960400001)(38100700002)(478600001)(107886003)(55016003)(83380400001)(33656002)(6506007)(53546011)(26005)(9686003)(186003)(966005)(7696005)(38070700005)(316002)(41300700001)(76116006)(66946007)(64756008)(66556008)(66476007)(6636002)(4326008)(66446008)(86362001)(8676002)(8936002)(5660300002)(2906002)(110136005)(66899021)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?MSnAtunoyNMhkDxGJ7uEH3FALszm5oSThenxDv+IGdIeUrkHKkQJiwAhT15R?= =?us-ascii?Q?eTVx1diAVaGaP/vFT6rTcT/eaBYoLJU+v2k4CE3KOQKmHYnABhieorHYYWkZ?= =?us-ascii?Q?VPrvPf7nLcbYNKaACYtR1dPOsYsdg20RONvdoLcl5oZe86R5Xr5RtfhX31sT?= =?us-ascii?Q?vxin7zoQOfuzeTs+BvY9SSnE+ueKjTBvGv2WbOC9yCdHDH7/wEMJVZ0J0Mhq?= =?us-ascii?Q?yTgAGOxqsorF7Mg6jt3SFp5sRmIH+3rkqGsT2XeCjiygwSkzwJ/OIU/rHh/C?= =?us-ascii?Q?dTd5j1JBCwKxLRPKu17Kedd08Q8cbkh3gUfT7Vd1XduTQcM+Z5cdTT2Ibl9C?= =?us-ascii?Q?TNa5CFug7kBSXnmHicj0rqMNSJhfz3CcA23esxDdufvljJ/7YEg0brAnYJeg?= =?us-ascii?Q?uM6uUD27hrq4OdcjNkOmf13SOPB5/Q0PKxHjHrci6qTRcqSmOaGsBy+SP8mt?= =?us-ascii?Q?kdXx7yACllQgygnuvXkq5N+tyMFEDQeUWSN41NGVH2veUbT+juNfq15oHzOS?= =?us-ascii?Q?+dBAx4+vzocJZ2iq/nEle/Q3/cmTIANtZKlnheSX6HRtWGmFfH3SSbWBMAVD?= =?us-ascii?Q?9aBUKGLuZX2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EIzywkKRvaJttoCX0x+tWDWz8Yxy7?= =?us-ascii?Q?55QdKViRiTWnJG+ZLQ8CHB14lAgwuuP24SXJyYTRMy33OO/eKIIuWTpow47q?= =?us-ascii?Q?fTipt7xrac+SKci08bY=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6158.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58ce6be7-1e24-464c-b1b7-08db61eb1dce X-MS-Exchange-CrossTenant-originalarrivaltime: 31 May 2023 15:24:24.7973 (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: nkNW0d1XW5NACS1AvslYTS2j2KtU3clThalh+RfrOHn/w4y89N+zQrwD5ltSe+T0TTwXGZIY5AEuMqWa/ZUZjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4916 Return-Path: jiaxin.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiaxin Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Wednesday, May 10, 2023 4:42 PM > To: Li, Zhihao ; devel@edk2.groups.io > Cc: Dong, Eric > Subject: Re: [edk2-devel] [PATCH v1 1/1] UefiCpuPkg/CpuService.c:check > cpu sync mode in SmmCpuRendezvous() >=20 > Reviewed-by: Ray Ni >=20 > > -----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() > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4431 > > > > In Ap relaxed mode, some SMI handlers should call SmmWaitForApArrival() > to 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(). > > > > Cc: Eric Dong > > Cc: Ray Ni > > > > Signed-off-by: Zhihao Li > > --- > > UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 19 +++++++++++++------ > > 1 file changed, 13 insertions(+), 6 deletions(-) > > > > 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 > > > > Implementation of SMM CPU Services Protocol. > > > > > > > > -Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
> > > > +Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -421,11 +421,18 @@ SmmCpuRendezvous ( > > goto ON_EXIT; > > > > } > > > > > > > > - // > > > > - // There are some APs outside SMM, Wait for all avaiable APs to arri= ve. > > > > - // > > > > - SmmWaitForApArrival (); > > > > - Status =3D mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : > > EFI_TIMEOUT; > > > > + if ((mSmmMpSyncData->EffectiveSyncMode !=3D > SmmCpuSyncModeTradition) > > && !SmmCpuFeaturesNeedConfigureMtrrs ()) { > > > > + // > > > > + // There are some APs outside SMM, Wait for all avaiable APs to ar= rive. > > > > + // > > > > + SmmWaitForApArrival (); > > > > + Status =3D mSmmMpSyncData->AllApArrivedWithException ? > EFI_SUCCESS : > > EFI_TIMEOUT; > > > > + } else { > > > > + // > > > > + // BSP has already waitted for APs to arrive SMM if SmmCpuSyncMode > > selected or need config MTRR. > > > > + // > > > > + Status =3D EFI_TIMEOUT; > > > > + } > > > > > > > > ON_EXIT: > > > > if (!mSmmMpSyncData->AllApArrivedWithException) { > > > > -- > > 2.26.2.windows.1 >=20 >=20 >=20 >=20 >=20