From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 39594940067 for ; Tue, 26 Dec 2023 02:21:40 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=vfF1JnxBGSZBhRW2a7REzznQ9Sc1/FCmQz7iEBrTC+8=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1703557298; v=1; b=kUKq3n2cV1V6Xf1Jvjlc93pd9ew+6Ay/U5HVeRIktNtvf13xy51WQ8hSJh+rmpWYE9YNlH3X M1707KLfpclGKo1zRF9MD0h9rokcAhpid/lFYSCV2JQNlGz0uvfyRKzodfbxJAuTCAudTWoq4Wo M8icWZQsR3ovZp7mDwXq+PME= X-Received: by 127.0.0.2 with SMTP id BHfDYY7687511xueZ5EYghkj; Mon, 25 Dec 2023 18:21:38 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.73530.1703557297745206088 for ; Mon, 25 Dec 2023 18:21:38 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="399099766" X-IronPort-AV: E=Sophos;i="6.04,304,1695711600"; d="scan'208";a="399099766" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 18:21:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="727630927" X-IronPort-AV: E=Sophos;i="6.04,304,1695711600"; d="scan'208";a="727630927" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 25 Dec 2023 18:21:37 -0800 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 25 Dec 2023 18:21:37 -0800 X-Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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.2507.35; Mon, 25 Dec 2023 18:21:36 -0800 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 25 Dec 2023 18:21:36 -0800 X-Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.168) 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.35; Mon, 25 Dec 2023 18:21:34 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RtBqgq1kLE4SkEjxlKzNaXUcSZ1NIcjCp9zR1n8daeOkFyKGIudr3MdrFVBNAHoNBZvxR9pp8XvsvGoHcaHss7ZbKBVVDSniKlU7nSGOQflgOWP1jfNicFLnlP3Glxbqn36B231rv0wOxwHt8yiP38ol2Qp7cF2siULt9Uah1nTrcHdL4t9xqMBxQLMEd63SgPZLZ4HsE0XC6FcTQHKMHyOrAKihSkLMetVqTgPiFLIK1JTgVwGHW5nlyqlykjqNTWREbvb7f/kn8BJaVND5jOtksNtSWknyZ5fSno5DCGWsAPOOTi9gGlHVqrUvKNKSd++lKXv6TscWpGgH3lwVug== 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=wFCHWN3BJrrWyw2/A2CzUq+RqEPHcjlNYO1RjUkyVkY=; b=FRpIa8o6EHjDBf+7TIUifKzZosYH4WEMoslgxcM3dSk4UcCKoImlpkeVlBmZMFNTIYhnrmLhJfzf0Tt2HpJuF83m+P64/ALZnLKtcX7Wd8lAdw8TdPfsIDGRctLg6accID8iP6bwHCDLjd15hlHvQyyjy1+vRvCVCmymKHfNexItLB/xPOV9TwfT50nQHdrczDroyTKJhQZlIMequ+llnXQVxnKTT4rZ2I0n9VfH1mn3yNjZ/WvmMdj3PT6R9EnYSbcKNWjm1KqCAuKKeQVHTDEpiNw0WwJOYKr8qOnGDMblwYJoGkn2vyB3qLHDHCi5+62eCa+SjhN7B5K2OOOGfQ== 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 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by DS0PR11MB7804.namprd11.prod.outlook.com (2603:10b6:8:f3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Tue, 26 Dec 2023 02:21:33 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::b614:1f5e:8b0c:9858]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::b614:1f5e:8b0c:9858%4]) with mapi id 15.20.7113.026; Tue, 26 Dec 2023 02:21:33 +0000 From: "Ni, Ray" To: "Wu, Jiaxin" , "devel@edk2.groups.io" CC: Laszlo Ersek , "Dong, Eric" , "Zeng, Star" , Gerd Hoffmann , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH v2 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Invert ReleaseAllAPs & InitializeDebugAgent Thread-Topic: [PATCH v2 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Invert ReleaseAllAPs & InitializeDebugAgent Thread-Index: AQHaN05UMFophpzKiU6wOePFo+av5rC61WsA Date: Tue, 26 Dec 2023 02:21:33 +0000 Message-ID: References: <20231225162034.2052-1-jiaxin.wu@intel.com> <20231225162034.2052-6-jiaxin.wu@intel.com> In-Reply-To: <20231225162034.2052-6-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|DS0PR11MB7804:EE_ x-ms-office365-filtering-correlation-id: 12ed557f-4cbf-427e-20e1-08dc05b960c8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: JkvG1tRfwhcsM8itj3l/7w8GtixFI5Ft12gLXHmQxk0KlhU2UJ+VAkFtRsWWgv6CAhPopD7st0MLbdRFGZpven33XPgnLhRKmfxycqXQk2rY9hE5F/jqbPdcAwNncCaWiTIV+EA4/Z0fasr1vgwurXQYSXRdzKg+q69XFI94EQn4xCbfWXP4Ae5UL3LrNVXQr2t0Xs0hBxYliJqqQtMeh0uyJehbNEm2pUtXVpy0PicizRGnmftUhXVklylsZNFksCtI9JW7d1vxVTZpqsRDOec+KR+G5jIsr3A0/NCnSdxveljNPtP6xHZAIAugSuWRH9PB3qmERf1x9uYuC81W3vuJUKKcl3ZpZ46AV4GcRFmk8kEqCcj5jvOMy3uDiJdKD5hDoFnxdLu7uNdlASL0YrQ+yJpZoRSD8UlxssbI+iMmm1gRr4GvBGUpDEVrDd0O7dta/pikg0aNmt4IMewBMZcwCvoUycY6W4NO0yvaaY0MPa69kYAq6zl0ow5ToXvM3ql3eCVGKXYN7Xt1uSqUEDZGJLCBREUlET1JPfhpTqf+GPGXJxE6W0UM4253dyTZpPpGLs+0/dWH6IYlQQ2cy8qoW4KAGURhlorvkzSG/p4KUHNOyWo+tlHfL2XkMbi8 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vJBFueoG2Wb+MrjK/5djfo6PSSohH8CMHGScgS0Xqwz56MaUFvW+bXroPwWu?= =?us-ascii?Q?o5e5h2SxuN0sgaXG4BE+QPd3LCoSKpv+Th1Ub+vB3LPwstCMbI0q44ZPcJ1q?= =?us-ascii?Q?RGIXhUPKWOktU4IUa46prkpsrtaot+2WSiOk50Wv8vtiESJjkBF2UKbAyfHx?= =?us-ascii?Q?TQZBR8tDnIwq2hdPbFPBIX4fedOiC5JSjbzXj/lmZ/IQCRFuGfCOkc/OujZt?= =?us-ascii?Q?W1MQ567he/5D8uxquVOOGTdIHTNnetTr5/OWyEvda654Abg6xTys6prYko7f?= =?us-ascii?Q?voIsO9zyW+GrTNqZn+p5wa9ejKKD12ILSPYe3cwd0UI9PrdKieACeWpJBaT8?= =?us-ascii?Q?wuUBKFo2OQdz51pX0fMBu1NrND4067+8AHetEpfuTbTiBhsJYiZigXXB4ktO?= =?us-ascii?Q?cdht+DtOl6BVRj61bQJqVZC5BPbAU+5O9RUs1KoQAwesiL/nWv3HdgnDPHXH?= =?us-ascii?Q?hkIUeQQD+FHx40QXYlFM5+zoUNGJohndG5XCL8Q2FmRaF5t/Yhrq6vgPXXXg?= =?us-ascii?Q?Q4Jn89rDnaLsUB7WbIBZ+e1lJIl+0jIyRqAeJs84ugr/cvrJ+UdyROXcd3U1?= =?us-ascii?Q?nP1ZlrASptky22yQLFJOJneX0uo3aV8qG4c6ga8p5XfsJYVo04AwIPATfbPO?= =?us-ascii?Q?mBiRBm44JFm7bTrooB+Ze0trcxTbxSD4C3NVdZ0+C8O3pZM9xgk7OM4F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IME-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: 12ed557f-4cbf-427e-20e1-08dc05b960c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Dec 2023 02:21:33.0514 (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: iJqse/nQuk1ib+3MDBhAwv1MmezMWBtyl9kuMj185ZmKE18ZV9XUux7xp6cXLEZmB30tMOCKC9GeRrzwDtXlxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7804 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: pwO2qCrIJjWFKbAfwuI5DFpux7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=kUKq3n2c; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Source level debugging in SMM doesn't enable timer interrupt so it does not= support break-in from HOST debugger. It only supports debugging AP code which is stopped by breakpoints. I agree that with this change, the debug window of APs is a bit increased. Reviewed-by: Ray Ni Thanks, Ray > -----Original Message----- > From: Wu, Jiaxin > Sent: Tuesday, December 26, 2023 12:21 AM > To: devel@edk2.groups.io > Cc: Laszlo Ersek ; Dong, Eric ; N= i, > Ray ; Zeng, Star ; Gerd Hoffmann > ; Kumar, Rahul R > Subject: [PATCH v2 5/6] UefiCpuPkg/PiSmmCpuDxeSmm: Invert > ReleaseAllAPs & InitializeDebugAgent >=20 > Existing BSP handler stops source level debug, then call ReleaseAllAPs > to tell all APs can reset the Present flag to FALSE: > InitializeDebugAgent (); /// Stop source level debug > ReleaseAllAPs (); /// Tell APs can reset "Present" flag. >=20 > This patch is to invert ReleaseAllAPs & InitializeDebugAgent: > ReleaseAllAPs (); /// Tell APs can reset "Present" flag. > InitializeDebugAgent (); /// Stop source level debug >=20 > After this change, there is no negative impact since SMM source level > debug feature doesn't depend on AP's "Present" flag, no impact to the > SMM source level debug capability. >=20 > Instead, the change will benefit the AP source level debug capability > to trace its "Present" flag change for SMI exit since the source > level debug feature will be stopped after each AP has the chance to > reset the state. >=20 > Cc: Laszlo Ersek > Cc: Eric Dong > Cc: Ray Ni > Cc: Zeng Star > Cc: Gerd Hoffmann > Cc: Rahul Kumar > Signed-off-by: Jiaxin Wu > --- > UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > index bd2c9f841b..9aa9908863 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > @@ -648,23 +648,23 @@ BSPHandler ( > // > // Wait for all APs to complete their pending tasks including MTRR > programming if needed. > // > SmmCpuSyncWaitForAPs (mSmmMpSyncData->SyncContext, ApCount, > CpuIndex); >=20 > + // > + // Signal APs to Reset states/semaphore for this processor > + // > + ReleaseAllAPs (); > + > if (mSmmDebugAgentSupport) { > // > // Stop source level debug in BSP handler, the code below will not b= e > // debugged. > // > InitializeDebugAgent (DEBUG_AGENT_INIT_EXIT_SMI, NULL, NULL); > } >=20 > - // > - // Signal APs to Reset states/semaphore for this processor > - // > - ReleaseAllAPs (); > - > // > // Perform pending operations for hot-plug > // > SmmCpuUpdate (); >=20 > -- > 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112903): https://edk2.groups.io/g/devel/message/112903 Mute This Topic: https://groups.io/mt/103360806/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-