From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id DC2ED940F6C for ; Tue, 16 Apr 2024 02:41:20 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=1w1M7nEt2pt3zuxxxd0kpMINBaJETsl8ZcUFa25G148=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1713235279; v=1; b=mr0VLXE45mr4gtDhmx9YqquMb3wuxGIT8kQUsDETO2G+kx6WCNyU9q/OGHEfgvzMIJin7/kC Lo4wEQay+p8dTmDlBost84i9SUWXlHtclz0UFBGkpN6xoANE3I5KBgTVnc2hd/fV1HpWglqqAH0 GQDMkDh3MmLDELicgZSbZk5x7zrmanCoKXhmsNDVmdUPcTn/kyuIKwmKJECqBViYfyYN4uBA5hg y0IhCbeluEgWRsykRYxwpHtDkipFX/K9idT6zr5LaqUZ6f37ag3GqPiXf7vtC7j5ca6wuSV6jvi MHh2GnjYmKxGtlqsdxDwa02Ba4SxqhzN1g4UiflGHq9xQ== X-Received: by 127.0.0.2 with SMTP id UoGBYY7687511xJ2FDhPl6zo; Mon, 15 Apr 2024 19:41:19 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mx.groups.io with SMTP id smtpd.web10.11001.1713235276662353128 for ; Mon, 15 Apr 2024 19:41:18 -0700 X-CSE-ConnectionGUID: a6fsWDn0RUyiO0yunu4Vsw== X-CSE-MsgGUID: fbWQnePPSQCw4QbVhgivAw== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="9205564" X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="9205564" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 19:41:19 -0700 X-CSE-ConnectionGUID: GI/xqQrHSg22tmDZdN+ZGA== X-CSE-MsgGUID: JcjQuCh/QG+SrsbgWI4Qyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="59553283" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 19:41:17 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Liming Gao , Jiaxin Wu , Ray Ni , Laszlo Ersek , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v4 1/6] Revert 2ec8f0c6407f062441b205b900038933865c7b3c Date: Tue, 16 Apr 2024 10:41:03 +0800 Message-Id: <20240416024108.1358-2-zhiguang.liu@intel.com> In-Reply-To: <20240416024108.1358-1-zhiguang.liu@intel.com> References: <20240416024108.1358-1-zhiguang.liu@intel.com> MIME-Version: 1.0 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 Resent-Date: Mon, 15 Apr 2024 19:41:18 -0700 Resent-From: zhiguang.liu@intel.com Reply-To: devel@edk2.groups.io,zhiguang.liu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1ZdnKOmNq6D7jlGGALxcxy16x7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=mr0VLXE4; 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 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io This reverts commit "StandaloneMmPkg: Disallow unregister MMI handler in other MMI handler" for better design later. Cc: Liming Gao Cc: Jiaxin Wu Cc: Ray Ni Cc: Laszlo Ersek Reviewed-by: Ray Ni Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Sami Mujawar Signed-off-by: Zhiguang Liu --- StandaloneMmPkg/Core/Mmi.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/StandaloneMmPkg/Core/Mmi.c b/StandaloneMmPkg/Core/Mmi.c index 9e52072bf7..c1a1d76e85 100644 --- a/StandaloneMmPkg/Core/Mmi.c +++ b/StandaloneMmPkg/Core/Mmi.c @@ -36,9 +36,8 @@ typedef struct { MMI_ENTRY *MmiEntry; } MMI_HANDLER; -LIST_ENTRY mRootMmiHandlerList = INITIALIZE_LIST_HEAD_VARIABLE (mRootMmiHandlerList); -LIST_ENTRY mMmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mMmiEntryList); -MMI_HANDLER *mCurrentMmiHandler = NULL; +LIST_ENTRY mRootMmiHandlerList = INITIALIZE_LIST_HEAD_VARIABLE (mRootMmiHandlerList); +LIST_ENTRY mMmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mMmiEntryList); /** Finds the MMI entry for the requested handler type. @@ -162,19 +161,13 @@ MmiManage ( // get next node before handler is executed, since LIST_ENTRY that // Link points to may be freed if unregister MMI handler. // - Link = Link->ForwardLink; - // - // Assign gCurrentMmiHandle before calling the MMI handler and - // set to NULL when it returns. - // - mCurrentMmiHandler = MmiHandler; - Status = MmiHandler->Handler ( - (EFI_HANDLE)MmiHandler, - Context, - CommBuffer, - CommBufferSize - ); - mCurrentMmiHandler = NULL; + Link = Link->ForwardLink; + Status = MmiHandler->Handler ( + (EFI_HANDLE)MmiHandler, + Context, + CommBuffer, + CommBufferSize + ); switch (Status) { case EFI_INTERRUPT_PENDING: @@ -321,13 +314,6 @@ MmiHandlerUnRegister ( return EFI_INVALID_PARAMETER; } - // - // Do not allow to unregister MMI Handler inside other MMI Handler - // - if ((mCurrentMmiHandler != NULL) && (mCurrentMmiHandler != MmiHandler)) { - return EFI_INVALID_PARAMETER; - } - MmiEntry = MmiHandler->MmiEntry; RemoveEntryList (&MmiHandler->Link); -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117818): https://edk2.groups.io/g/devel/message/117818 Mute This Topic: https://groups.io/mt/105550115/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-