From nobody Wed May 1 17:49:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1521443719263605.9921439728209; Mon, 19 Mar 2018 00:15:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4F8682258AF12; Mon, 19 Mar 2018 00:08:49 -0700 (PDT) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 31A3A22571B4B for ; Mon, 19 Mar 2018 00:08:46 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2018 00:15:14 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.10]) by fmsmga004.fm.intel.com with ESMTP; 19 Mar 2018 00:15:13 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,329,1517904000"; d="scan'208";a="38618101" From: Hao Wu To: edk2-devel@lists.01.org Date: Mon, 19 Mar 2018 15:15:09 +0800 Message-Id: <20180319071509.16380-1-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 Subject: [edk2] [PATCH] MdeModulePkg/DxeMain: Fix BSP interrupts reenabled in ExitBootServices X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Eric Dong , Hao Wu , Jiewen Yao , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Within function CoreExitBootServices(), this commit will move the call of: MemoryProtectionExitBootServicesCallback(); before: SaveAndSetDebugTimerInterrupt (FALSE); and gCpu->DisableInterrupt (gCpu); The reason is that, within MemoryProtectionExitBootServicesCallback(), APIs like RaiseTpl and RestoreTpl maybe called. An example will be: DebugLib (using PeiDxeDebugLibReportStatusCode instance) | v ReportStatusCodeLib (using DxeReportStatusCodeLib instance) | v Raise/RestoreTpl The call of Raise/RestoreTpl APIs will re-enable BSP interrupts. Hence, this commit refine the calling sequence to ensure BSP interrupts before leaving CoreExitBootServices(). Cc: Ruiyu Ni Cc: Jiewen Yao Cc: Jian J Wang Cc: Star Zeng Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Ruiyu Ni reviewed-by: jiewen.yao@intel.com --- MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dx= e/DxeMain/DxeMain.c index 62a597edaf..07c7403462 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -1,7 +1,7 @@ /** @file DXE Core Main Entry Point =20 -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD = License which accompanies this distribution. The full text of the license may be = found at @@ -805,6 +805,8 @@ CoreExitBootServices ( (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES) ); =20 + MemoryProtectionExitBootServicesCallback(); + // // Disable interrupt of Debug timer. // @@ -815,8 +817,6 @@ CoreExitBootServices ( // gCpu->DisableInterrupt (gCpu); =20 - MemoryProtectionExitBootServicesCallback(); - // // Clear the non-runtime values of the EFI System Table // --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel