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 E335B7803CD for ; Thu, 29 Feb 2024 12:24:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=gJUQK/k1KGOSMAkrTnlRoO9ukWTH3FD6ZutvUE6kmWU=; 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=1709209480; v=1; b=T4WnfRjYejIny1IvFA7AHQ4h2fIvs63b3ciLnxLiiqrIdDLNNO8zm+v9DWBS6NaXihCsEalt KKZuu5vnO5z11u1bZGS0xizFvjSJqORCcrfgcQvsRQzpqaOhYDSqQ591cuE0SWtVZHEI+aHxFti I/arh8yrvSt62ZXOwUOD76tk= X-Received: by 127.0.0.2 with SMTP id IIOYYY7687511xQTQpxqFkEd; Thu, 29 Feb 2024 04:24:40 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mx.groups.io with SMTP id smtpd.web10.23743.1709209480069589769 for ; Thu, 29 Feb 2024 04:24:40 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="14310881" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="14310881" X-Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 04:24:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="8374431" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 29 Feb 2024 04:24:30 -0800 X-Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) 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.35; Thu, 29 Feb 2024 04:24:29 -0800 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.35 via Frontend Transport; Thu, 29 Feb 2024 04:24:29 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.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.2507.35; Thu, 29 Feb 2024 04:24:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W7sdy9oXUB/0DFtezIeQNqndEtM8cv122yrMyNOS9I0Jlmr++buPl3K9UGkilgeLvBFMmHdoKtWQiZpifgxd3WViDX7gtGCrNCv9tQgBCzk02TJLYp7XSFYP9KdtwOESckXTX09HZop4hUEJslqoX/e/iKcepmZMXWe7UBQENvYCHo06BgiU/2d/kdvN/6I0k/fmU/li3mK3a2iRFgG8e6a7QqguGMcFDVLGhKfdq2tQxbB0RyoaU0qapOpDsyNYI6DtTqfAJsWd+pMd4nT8pIARI7QYr+T83l+Xb7Yd0Rq5sRdcdmzFAr5e2KxyzNOpvm+Hs8HWMRMNxizwefsLNQ== 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=Oet/QYhvMNJeskkx3LpPk5ulI+TFXHzL56n22xHA1JE=; b=bOksLCxeSUxi5pm2WIHI2PLitBwM5VppV8os1yLTWdeDDJMYf+dvOFE8LbFrcKDtGFbjyFFsmSBzlR32MKlS3q5eTu+gkiG3xoBO6PLc4YwfrIGsJzls0i2uepn7b2oL/QHQXhm5uaAFRjab6+CzB79xUI3T5FAcWvld1o6U3c1AYDPs1uMNREKSHAWYfp2oHQuH2F3mHT/NkvrsnU5unGfK2GLZC34Q4sh0Wc5tkCLTmk92u5959PdH+lrhwhzg96Ztmq7PQUczXzKY3jbaOpHysH2PjdFfVb5mg09LQB9QjA3C862MW+qI2OtM2yyRVbxBK4oGuyOlBljx5DIn9Q== 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 SN7PR11MB6921.namprd11.prod.outlook.com (2603:10b6:806:2a8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.26; Thu, 29 Feb 2024 12:24:27 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817%5]) with mapi id 15.20.7362.013; Thu, 29 Feb 2024 12:24:27 +0000 From: "Ni, Ray" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: Liming Gao , "Wu, Jiaxin" , Laszlo Ersek Subject: Re: [edk2-devel] [PATCH v2 1/4] MdeModulePkg/SMM: Support to unregister SMI handler inside SMI handler Thread-Topic: [PATCH v2 1/4] MdeModulePkg/SMM: Support to unregister SMI handler inside SMI handler Thread-Index: AQHaae3PEbm8rxSPmkidzo03gwzeYbEhQJrw Date: Thu, 29 Feb 2024 12:24:27 +0000 Message-ID: References: <20240228022750.873-1-zhiguang.liu@intel.com> <20240228022750.873-2-zhiguang.liu@intel.com> In-Reply-To: <20240228022750.873-2-zhiguang.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|SN7PR11MB6921:EE_ x-ms-office365-filtering-correlation-id: 64ab5b23-bfc0-4c7a-4835-08dc39215f31 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: mR41Ab/hEQyFVK4aCH9wsIap0bxp9W+ZKRcH4CclBXBWjSDT3TqX+JLK68Jo4xQht++dGJ9ZkdEF+sR5oLNPOYJ8wG+5T3XBRaCD8ft66GalCVCSvvr//+lwqvPfVRcEIJQqXwn1+yoVgDvURrh5SGy9skazGpyiEwR2F4BmK4e76ZHUxryMCArVqpsdol/cm30uu18RjY8DeewVGbk2UAuh9QZs3nbFUJ7TDsRlK2YuxaoTnAFiWaV63FfuTJstwcK4eKRbSVowNQ1EQTmhHl+myRmFHVp2Qg9WaTMDcYQBXJmhV/BuwzaFdb5YQ+U49EdenULiqddoXT4xhpbERmQq4k1qsifTdrPWlNQTkCES+EkWRh1lGRt5cRJlGU0p/7aBFTC0BP5B9xKkqfCQmWufoBsVfYrHzVjrKXjqQbUBvB372JKMZ6QJw33+Y1nI/ol7vwzcRzBdY6ezGtAqmiROWobg036Otdx8FysSVYPTgGLVwh7Jq98+4As/zQwxBsnmSnc4onuyGDwU0UxzCooB+h/UL3uzbjMctqs5lfYQIgpbgv8qPwgMDdc9K7HEKpCYDE5QEBpqHRc187osNdnDdohhX/lG9G8WAXHE8RudkDxR1BbMhmQWAA9tJZJ71ATQVOjvhUcm3HSZJNgMAOePFVdHH/qt7hIsXd6+qercWIjfDTj70KClaIXDi3j0P9LWF+S+lCH8QTsQYasugQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6nNge/T3dvgC4t1DrSsc2NRqrFwrcE7TGDfUAQU70t31HEYgF52y1uyXR77/?= =?us-ascii?Q?u0fsxPEQJXjR0ZbM4l5LEP3MsVx/oMO46ECDvy3g1vuJRYLV0//C/9twSLzq?= =?us-ascii?Q?38idqKNbGg3CYyyGq4nx6Jt0Re7tnPWMKSGywltImAxHNWuWVLq43xaW77kC?= =?us-ascii?Q?6F9CSpEtiep+h0+hr6jyccmiOw5s1j70ccFKFz0rYy97jn2KOnsvvctZammP?= =?us-ascii?Q?Q1z4eZXROrHdX8yoKz/gJFWvaYO6Tim46sAfNFgjU9tf8bRwqDaHv9ducEcd?= =?us-ascii?Q?kwAs23CiMlLQLMMmLEYhRvfP/gHBqdGHqhalcKgfrrMmNsw75jvKY3raBlbG?= =?us-ascii?Q?FHjYRjgURl72FDXddF5bgwUcR+Hcb0ALgEwicw6yxO5u4Y+EHK+d4RSs4Trr?= =?us-ascii?Q?6L+gwVuqj7tFSayh1bLDuvG4jFhALjhF9tKz6mxiCfEqn0LLoTeeGBtH6x5S?= =?us-ascii?Q?cIpblIZu0qCrvdLu6NcQmQhG4xQ7tynnYfzOI3YFP25+gF8VxeKs+v7FODpu?= =?us-ascii?Q?qjFtl/3Upzo5ACovA6Ni4zzFtjGWum2LPeATertI0FtvrJ99m5foNRrJPVx7?= =?us-ascii?Q?enT3/EzqYfkbdVlyJo2t/NYtBNZ93J6U6SGP4hLeYElvI0lEiRcHATjWU6qb?= =?us-ascii?Q?VDGFdAXs0j3FKBIxJOMBhd8Tf8fh1mtVoz4wub0KC86bECyUEC1VLLTFtUhv?= =?us-ascii?Q?hRzh7YInnUwFzmb94FgwI4wN3d/JT+jtriswlSnIZ9+zYk1Cs+6c7A0rJXxC?= =?us-ascii?Q?/OPemJExv40yZ2QGB0yavgKl6EYfT1v/K/7GqWYv1kbH996rzcmQjjRlccfc?= =?us-ascii?Q?URwu8DdSM7kWHYFQb3Ea9ZBc+mZ7OXKTwyUnenW0ihgrp6FjlD+qLu3OnbMm?= =?us-ascii?Q?zhL/1nh5+I0ybMeq2wmsPfUz0csioPTKDc5LgFgTP1LOmKHwpc3SKjJq5wmo?= =?us-ascii?Q?XFFhAHUae21BzG/ehycsWNdJUfUBmRxRCCiLo5boN5wD4lx5RQQkvhmoXAGJ?= =?us-ascii?Q?vLxEkTx5xR0INV9vnsIu9otoiOvskKmB8u7ks3xrsSi7y8YrgXQQvp2534YC?= =?us-ascii?Q?iXADznQsKCU+jAOgsqNjaKofBCbgLf31prCwQiRLVY6ZeBZBAE0lC8RxUtQc?= =?us-ascii?Q?Up2YK4jHD688QwBHjp9rRsVsYp2fAwse2kVlKRNoQBRwytTMpCtLe/HcpXVX?= =?us-ascii?Q?CTVoprmJzv2FMNWAxMvrAd67xG9NW+MhIkMRXkaV1vy688vVROXnF/7/DtMv?= =?us-ascii?Q?hLLB4iYfZoiXGhk9vdJfM98gsaBJzTwraTn6Qddcr0eUq2J27IxYhy9st9Bj?= =?us-ascii?Q?2m0ix+DKTCkOLJ8owkRrffCUPgOx3qV99sv0+YRLIybw58J3AtEiJ6vSHTST?= =?us-ascii?Q?swoZGECZ9xSXfCwg0UXPhvOsd9hu8EHhMggIFsK5b9COr51VCZtHNMFnDdRO?= =?us-ascii?Q?3FJ1E+9+aT9jz9G4zPA88pG917tmGdLRdqwuZZBGfyiKR5veDrU1u6yJqsOD?= =?us-ascii?Q?SFtmg5yIze6k9wms5YqzgFPbA0KlLiuU0tDJI6Rq8KPlJjkYHDfcvFVovt2C?= =?us-ascii?Q?024HOPSavQUUaASGkZg=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: 64ab5b23-bfc0-4c7a-4835-08dc39215f31 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Feb 2024 12:24:27.3352 (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: CqZbmkVpRUYpv3N8UV47+NRMWMtDRrQmxzwENDhwDW/7WuXxwpLI78fTtMuXd2SL85N3wwHcU8EnAm2Y2ax/6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6921 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: tfIhIlGxWf6BlMh1rGCuvW5qx7686176AA= 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=T4WnfRjY; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 Reviewed-by: Ray Ni Thanks, Ray > -----Original Message----- > From: Liu, Zhiguang > Sent: Wednesday, February 28, 2024 10:28 AM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Liming Gao > ; Wu, Jiaxin ; Ni, Ray > ; Laszlo Ersek > Subject: [PATCH v2 1/4] MdeModulePkg/SMM: Support to unregister SMI > handler inside SMI handler >=20 > To support unregister SMI handler inside SMI handler itself, > get next node before SMI handler is executed, since LIST_ENTRY that > Link points to may be freed if unregister SMI handler in SMI handler > itself. >=20 > Cc: Liming Gao > Cc: Jiaxin Wu > Reviewed-by: Ray Ni > Reviewed-by: Laszlo Ersek > Signed-off-by: Zhiguang Liu > --- > MdeModulePkg/Core/PiSmmCore/Smi.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c > b/MdeModulePkg/Core/PiSmmCore/Smi.c > index 2985f989c3..3489c130fd 100644 > --- a/MdeModulePkg/Core/PiSmmCore/Smi.c > +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c > @@ -134,8 +134,14 @@ SmiManage ( >=20 > Head =3D &SmiEntry->SmiHandlers; >=20 > - for (Link =3D Head->ForwardLink; Link !=3D Head; Link =3D Link->Forwar= dLink) { > + for (Link =3D Head->ForwardLink; Link !=3D Head;) { > SmiHandler =3D CR (Link, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE); > + // > + // To support unregister SMI handler inside SMI handler itself, > + // get next node before handler is executed, since LIST_ENTRY that > + // Link points to may be freed if unregister SMI handler. > + // > + Link =3D Link->ForwardLink; >=20 > Status =3D SmiHandler->Handler ( > (EFI_HANDLE)SmiHandler, > -- > 2.31.1.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 (#116164): https://edk2.groups.io/g/devel/message/116164 Mute This Topic: https://groups.io/mt/104616992/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-