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 BCC95740039 for ; Tue, 16 Apr 2024 02:41:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ji98DOGFt8fCt9y9REcu6GH/TArvh9vd2hVou6qud5Q=; 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=1713235284; v=1; b=3v1AznRsXSg8McpedJdMqPdUzn2wPzpy76YxUhTwTHdeJRhvJOyoeCw1JmMw0awYAUv4F/zZ LMw97CsMrIXhDE3Yekr4yhus3L8/Mu3izxnGLSpTk6xsDZyIq8AwpGE6b0uUkTneaf9gRRDBGE+ t7KaQyo+hlVoiwnFvNgtl2ATmvgFB4e+SF5EDjq9eQ2Yju636wSXPYQx6Kwc8+K1n6gYuWXQTKF LSCFNKNYobKLcgMtCkPQvjUm8EUAjfbYSIdNMII5NwzrT7KNiSMBCqg2MP8AoxIA0qquhgmUePR 7xtNDM/RaN67aUceNnwY9WHekAQxnA+lTfjcDx2+ss/PA== X-Received: by 127.0.0.2 with SMTP id V1F9YY7687511xC5F9Hh2HHg; Mon, 15 Apr 2024 19:41:24 -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:23 -0700 X-CSE-ConnectionGUID: Eemg/v53ShmHJpExGRv83w== X-CSE-MsgGUID: Z1AIh8VVRlapdbGyx67ovg== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="9205578" X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="9205578" 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:23 -0700 X-CSE-ConnectionGUID: 03/IZ3CqTwqYz2NYUQXI4A== X-CSE-MsgGUID: JrWCJYa1T4CZWjfTwHzY5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="59553303" 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:21 -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 3/6] Revert 17b28722008eab745ce186b72cd325944cbe6bf0 Date: Tue, 16 Apr 2024 10:41:05 +0800 Message-Id: <20240416024108.1358-4-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:23 -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: 0FZ5FDOm0mkHCGtoojk1okaax7686176AA= 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=3v1AznRs; 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 "MdeModulePkg/SMM: Disallow unregister SMI handler in other SMI 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 --- MdeModulePkg/Core/PiSmmCore/Smi.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c b/MdeModulePkg/Core/PiSmmCore/Smi.c index b3a81ac877..3489c130fd 100644 --- a/MdeModulePkg/Core/PiSmmCore/Smi.c +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c @@ -8,8 +8,7 @@ #include "PiSmmCore.h" -SMI_HANDLER *mCurrentSmiHandler = NULL; -LIST_ENTRY mSmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mSmiEntryList); +LIST_ENTRY mSmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mSmiEntryList); SMI_ENTRY mRootSmiEntry = { SMI_ENTRY_SIGNATURE, @@ -143,18 +142,13 @@ SmiManage ( // Link points to may be freed if unregister SMI handler. // Link = Link->ForwardLink; - // - // Assign gCurrentSmiHandle before calling the SMI handler and - // set to NULL when it returns. - // - mCurrentSmiHandler = SmiHandler; - Status = SmiHandler->Handler ( - (EFI_HANDLE)SmiHandler, - Context, - CommBuffer, - CommBufferSize - ); - mCurrentSmiHandler = NULL; + + Status = SmiHandler->Handler ( + (EFI_HANDLE)SmiHandler, + Context, + CommBuffer, + CommBufferSize + ); switch (Status) { case EFI_INTERRUPT_PENDING: @@ -334,13 +328,6 @@ SmiHandlerUnRegister ( return EFI_INVALID_PARAMETER; } - // - // Do not allow to unregister SMI Handler inside other SMI Handler - // - if ((mCurrentSmiHandler != NULL) && (mCurrentSmiHandler != SmiHandler)) { - return EFI_INVALID_PARAMETER; - } - SmiEntry = SmiHandler->SmiEntry; RemoveEntryList (&SmiHandler->Link); -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117820): https://edk2.groups.io/g/devel/message/117820 Mute This Topic: https://groups.io/mt/105550117/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-