From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.11673.1684395251057385614 for ; Thu, 18 May 2023 00:34:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ZsbsMMSS; spf=pass (domain: intel.com, ip: 134.134.136.65, 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=1684395251; x=1715931251; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=nnYix+be4sk4pgYyqErN21402Wty6OGD3vPMOva2Rl4=; b=ZsbsMMSSkcfyuozFp3ofIy8dSwyoBpBbvqLqdGMg40UXIlPbg5AeMZ81 W1n8peESbPhb2SVBjUWu4+efAWjBpNxSn7uJ9BnGunrZStM/6VMfTOjxW Go89/sTpld1tbUcls0IubGv6HC27Yg/QI8IZOpqulXRYGnWer4QbICgGI fHYwV5AuMvXh+U89L8uH1wkfad5QqKNE+0Lm/ROWAdSUIrIWrIwTyLSia n0I8SZI7FlOAruClRDKlOqNJZZUj6M7kKYnwdFTbKH8c23x1S+OarV6h9 /naeQR/tDtOXeERM52qInz+wd88/JuT6CjIdPGgYq+9fMm2QQpjPAi3ea w==; X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="355186539" X-IronPort-AV: E=Sophos;i="5.99,284,1677571200"; d="scan'208";a="355186539" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2023 00:33:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="679576119" X-IronPort-AV: E=Sophos;i="5.99,284,1677571200"; d="scan'208";a="679576119" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 18 May 2023 00:33:30 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2507.23; Thu, 18 May 2023 00:33:30 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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, 18 May 2023 00:33:30 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Thu, 18 May 2023 00:33:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D7vuQAPlxJLt/W2Rcor9lDxBzOpB/g9xthQb0GkiRnxpxMEGfEoltH4yEYdmNdncd9Eil9CBzKjj4Yqe7Uboft2RYVeTNJby2/ynXQKbjsVhxKRt0LLxAxqJhK/vvxJkJZVnikbqVHtQclkpmpDQcKjvtYGJkAs1STbvpmoGEhhSBKow5DOjSO86v3BSsbHQW/Fb58ZT66S/vZimEhOLVGUIX1YvdRNss8HSGqjrSJHoK2rzuWH/wXTdQk1tmgO8ounq8dl7Q6x9YfeDkxy9yjcW9822v69ux+XEePw3WRpPAoSgslonAuqjg8DlJz6x4qMiMo18gLy5VCuh2d68Mw== 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=7O8CiXigBIxbJmZsbgU/2rboh9cwldhVdG3IqEXLdgo=; b=gBmVGPBMYuA10MHpm2Oct9u8NVaEaSZO9m3NwrabcM0G59Lj4jagqJTTQeWf5/7hWFmQ9MfyKx7kcigQLAx/5wmU3JFLvBGBiArEfynZLt7KxMj6K5vmKQPiLV3rkGVthyqXgeQxZaPcVt9Twzaa9TJ0lVnwKbS8SZ7XVHgtbwqE+ICFJWViAwbEqYQ4bhZprW/fDMJFm8JB8l7mgdIu4QiUHmzxMQrHe9Ob98HonQWEcCm4dowzsLDFH+HJF/F8H2Me6h+E//Xezpbb3dq8kqUWN+B6YbZ60bhnVM0g73R2zRl1A/eGnR7jET80/2lUFWtCtJe3hHOY7Hi2BUdWcQ== 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 CY8PR11MB7266.namprd11.prod.outlook.com (2603:10b6:930:99::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Thu, 18 May 2023 07:33: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.6387.032; Thu, 18 May 2023 07:33:26 +0000 From: "Ni, Ray" To: "Li, Zhihao" , "devel@edk2.groups.io" CC: "Dong, Eric" Subject: Re: [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm:add Ap Rendezvous check in PerformRemainingTasks. Thread-Topic: [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm:add Ap Rendezvous check in PerformRemainingTasks. Thread-Index: AQHZflcI0zmEUox1vUC311qBU/2eva9fuV2w Date: Thu, 18 May 2023 07:33:26 +0000 Message-ID: References: <20230504070653.458-1-zhihao.li@intel.com> In-Reply-To: <20230504070653.458-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_|CY8PR11MB7266:EE_ x-ms-office365-filtering-correlation-id: 76617622-f5ba-4691-9963-08db57722b0d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5rLt43xUjsz4RZL0N2BzikpyynVPvhpT8WpI8xH1QC+ReXC+2Grmw/CLnsLpSt4lUv471UKwg2TLyWjTfUWaaigm6AdES3HdpdMW+gjT3gUPxCV/G+99P082ywmGRsQzbjGXgs1iGJkFxnRZCYymqEAmQoCirp7AK2IP/4YYCJ9tV8XYlEpkwmbkKFglwxXNWC+UbcHz9HlpDQ4f2OY10pHyAFWOziwxXuL0A9yC66J2fupRGMd6zIBjQfW74ygo+lenp1gHuj1WqojoaIgM1LUfFj6d+I/Hl0cpJa6e2ix9JQPJVLSNxTKetjBGPRKetdNxgq965p54pZURBn6Ek0vN/cLqyMyvYD47J362SC52U3SBhywz7r9Ob2IXyeqL5o/5gI/QsUPOLIw897msfvxn8qICRncp0azntCBXPapYEYwE9GL4Lntei7qA+2KuYV+Q7Hf1Y5BjN09BaFrkZXp5cO1p/dkPQuZqpawiahJ1KyjJjlhcmjBQ6u9q4sMZeoJ2ROhkOLoX9o5fYXvgADemJP4yH1MRLvq+qW+AgECqJoKnFcY+2gYHf/wBkMZwffoGqFR45phulE7vxwlm08hbf5UGgqKL6W54MtsaVl0= 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)(6029001)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199021)(478600001)(26005)(6506007)(9686003)(53546011)(107886003)(7696005)(966005)(71200400001)(66946007)(66446008)(38100700002)(66556008)(55016003)(82960400001)(4326008)(64756008)(41300700001)(66476007)(316002)(86362001)(122000001)(2906002)(38070700005)(83380400001)(76116006)(8936002)(33656002)(8676002)(5660300002)(52536014)(186003)(110136005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?thM6NctUNLfq/UFnpza2pTQte5PwbYPGZEPXi4DguJNWRane4v9p/jJq4Ynm?= =?us-ascii?Q?GCsDvpS3lPxI7SHhyOf6wJ3ax/AvCMgrAuk99W9eD0/XLbGHl5tXdyyFWkf2?= =?us-ascii?Q?KBQq6VB8cPj5XIxQJ/G7s3J5RbPO6mpFWQdpWHrRIkX9qnoCqmnB4+lPGUTV?= =?us-ascii?Q?NceM3lZNRVZ/55xyYJF+dnzcWfaomLHancDNE4O1Ln9hPOv7/kqFg1hjKKiK?= =?us-ascii?Q?XrShJY4UOlfe+8tZfyrMVubAl7G1BXkvkWk7bPZBgOTU1YjnxXFDuqHKnflr?= =?us-ascii?Q?MoGWFSXs3XY3OrJClL+3eFFxRnT7f80H985LyHjySwe3NTtMuR/eXuOjND8K?= =?us-ascii?Q?7mOeh90QYzBWmxHC/7KbG9V0LV3uqDqSJox54Csra7jVnlqoeDrKEYGFUnbI?= =?us-ascii?Q?hm0SpOK60DIjxmz5IDy7qdlp40G+RHlcpu5x5TnN+fPnbLwzBly+43UuHjy3?= =?us-ascii?Q?JmYfHzr8lrvhCENbz+ntZ+ZDXqQgkcn6Wz6skNNai2DQ4EfzGYPVVESEV7oO?= =?us-ascii?Q?9oLROTSIQtNQsh1FZ40nzShM20kjxYNqxDB/s6nC3Htt9L0vMAOYMBipqicy?= =?us-ascii?Q?lJqey/4t7XSS/2Upn5SP4dwx6JKguNMucgG0/xDb7/Dj7VzslMO6C69hwg3e?= =?us-ascii?Q?feixLtONKyRiEGNt3gD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zO79?= =?us-ascii?Q?lQviLo73L7iXxrGE1ZE=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: 76617622-f5ba-4691-9963-08db57722b0d X-MS-Exchange-CrossTenant-originalarrivaltime: 18 May 2023 07:33:26.3187 (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: I2z9vyoOOh1yZgeMsJ2M7OVfnObL2ZHIuwGI57M9H5hje2ItOUdkVyW4Thco9C2CIP6VXBJC7Ac4Bj1xRY820Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7266 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: Thursday, May 4, 2023 3:07 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray > Subject: [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm:add Ap Rendezvous > check in PerformRemainingTasks. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4424 >=20 > In Relaxed-AP Sync Mode, BSP will not wait for all Aps arrive. However, > PerformRemainingTasks() needs to wait all Aps arrive before calling > SetMemMapAttributes and ConfigSmmCodeAccessCheck() when > mSmmReadyToLock > is true. In SetMemMapAttributes(), SmmSetMemoryAttributesEx() will call > FlushTlbForAll() that need to start up the aps. So it need to let all > aps arrive. Same as SetMemMapAttributes(), ConfigSmmCodeAccessCheck() > also will start up the aps. >=20 > Cc: Eric Dong > Cc: Ray Ni >=20 > Signed-off-by: Zhihao Li > --- > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) >=20 > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > index 655175a2c6db..1e210beb0e06 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > @@ -1,7 +1,7 @@ > /** @file >=20 > Agent Module to load other modules to deploy SMM Entry Vector for X86 CP= U. >=20 >=20 >=20 > -Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
>=20 > +Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.
>=20 > Copyright (c) 2017, AMD Incorporated. All rights reserved.
>=20 >=20 >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -1441,6 +1441,19 @@ PerformRemainingTasks ( > ) >=20 > { >=20 > if (mSmmReadyToLock) { >=20 > + // >=20 > + // Check if all Aps enter SMM. In Relaxed-AP Sync Mode, BSP will not= wait for >=20 > + // all Aps arrive. However,PerformRemainingTasks() needs to wait all= Aps > arrive before calling >=20 > + // SetMemMapAttributes() and ConfigSmmCodeAccessCheck() when > mSmmReadyToLock >=20 > + // is true. In SetMemMapAttributes(), SmmSetMemoryAttributesEx() wil= l call >=20 > + // FlushTlbForAll() that need to start up the aps. So it need to let= all >=20 > + // aps arrive. Same as SetMemMapAttributes(), > ConfigSmmCodeAccessCheck() >=20 > + // also will start up the aps. >=20 > + // >=20 > + if (EFI_ERROR (SmmCpuRendezvous (NULL, TRUE))) { >=20 > + DEBUG ((DEBUG_ERROR, "PerformRemainingTasks: fail to wait for all = AP > check in SMM!\n")); >=20 > + } >=20 > + >=20 > // >=20 > // Start SMM Profile feature >=20 > // >=20 > -- > 2.26.2.windows.1