From nobody Sun May 5 11:12:54 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1527837730161109.03384879325574; Fri, 1 Jun 2018 00:22:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9FDF6210E0F85; Fri, 1 Jun 2018 00:22:07 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 0729F210D6CCA for ; Fri, 1 Jun 2018 00:22:05 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jun 2018 00:22:05 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by orsmga004.jf.intel.com with ESMTP; 01 Jun 2018 00:22:04 -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.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@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.49,464,1520924400"; d="scan'208";a="204444467" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Fri, 1 Jun 2018 15:22:10 +0800 Message-Id: <20180601072212.99856-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180601072212.99856-1-ruiyu.ni@intel.com> References: <20180601072212.99856-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 1/3] MdeModulePkg/DxeResetSystemLib: Avoid depending on UefiRuntimeLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao , 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" Current DxeResetSystemLib depends on UefiRuntimeLib because it calls EfiResetSystem() API exposed by UefiRuntimeLib. Due to the commit XXX which reverts UefiRuntimeLib to only support DXE_RUNTIME_DRIVER, removing UefiRuntimeLib dependency makes the DxeResetSystemLib can be used by DXE drivers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Liming Gao --- MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c | 10 +++++---= -- MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c b/M= deModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c index ea452e3231..76bca223ae 100644 --- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c +++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.c @@ -14,7 +14,7 @@ =20 #include #include -#include +#include =20 /** This function causes a system-wide reset (cold reset), in which @@ -30,7 +30,7 @@ ResetCold ( VOID ) { - EfiResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); } =20 /** @@ -45,7 +45,7 @@ ResetWarm ( VOID ) { - EfiResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL); + gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL); } =20 /** @@ -60,7 +60,7 @@ ResetShutdown ( VOID ) { - EfiResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL); + gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL); } =20 /** @@ -94,5 +94,5 @@ ResetPlatformSpecific ( IN VOID *ResetData ) { - EfiResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, ResetDa= ta); + gRT->ResetSystem (EfiResetPlatformSpecific, EFI_SUCCESS, DataSize, Reset= Data); } diff --git a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf b= /MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf index 6eb2766b93..0d97d5899b 100644 --- a/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf +++ b/MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf @@ -35,5 +35,4 @@ [Packages] MdeModulePkg/MdeModulePkg.dec =20 [LibraryClasses] - UefiRuntimeLib - + UefiRuntimeServicesTableLib --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 5 11:12:54 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1527837732506538.4832424869226; Fri, 1 Jun 2018 00:22:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D6CE1210E0FAB; Fri, 1 Jun 2018 00:22:08 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 150BE207E541B for ; Fri, 1 Jun 2018 00:22:07 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jun 2018 00:22:06 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by orsmga004.jf.intel.com with ESMTP; 01 Jun 2018 00:22:05 -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.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@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.49,464,1520924400"; d="scan'208";a="204444473" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Fri, 1 Jun 2018 15:22:11 +0800 Message-Id: <20180601072212.99856-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180601072212.99856-1-ruiyu.ni@intel.com> References: <20180601072212.99856-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 2/3] MdeModulePkg: Make sure ResetSystemRuntimeDxe uses ResetSystemLibNull X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao , 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" Because the DxeResetSystemLib calls gRT->ResetSystem(), make sure the gRT->ResetSystem() implementation doesn't call into DxeResetSystemLib to avoid chicken-egg issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Liming Gao --- MdeModulePkg/MdeModulePkg.dsc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index ec24a50c7d..734c5e5ab7 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -363,7 +363,10 @@ [Components] ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseReset= SystemLibNull.inf } - MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf { + + ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseReset= SystemLibNull.inf + } MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.inf =20 --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 5 11:12:54 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; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1527837736233994.6819914452254; Fri, 1 Jun 2018 00:22:16 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 18EDA210E0FBF; Fri, 1 Jun 2018 00:22:10 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 34ADF210E0FAB for ; Fri, 1 Jun 2018 00:22:08 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jun 2018 00:22:08 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by orsmga004.jf.intel.com with ESMTP; 01 Jun 2018 00:22:07 -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.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@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.49,464,1520924400"; d="scan'208";a="204444478" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Fri, 1 Jun 2018 15:22:12 +0800 Message-Id: <20180601072212.99856-4-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180601072212.99856-1-ruiyu.ni@intel.com> References: <20180601072212.99856-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 3/3] MdePkg/UefiRuntimeLib: Do not allow to be linked by DXE driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Star Zeng , Liming Gao 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" When UefiRuntimeLib links to a DXE driver, its constructor still registers a Virtual Address Change event. The event callback will get called when RT.SetVirtualAddressMap() is called from OS. But when the driver is a DXE driver, the memory occupied by the callback function might be zeroed or used by OS since the BS type memory is free memory when entering to RT phase. The patch reverts commit 97511979b4fdd84cf7cd51e43c22dc03e79bd4f3 "MdePkg/UefiRuntimeLib: Support more module types." It makes sure that DXE driver cannot link to this library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Liming Gao Cc: Star Zeng Reviewed-by: Liming Gao --- MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf b/MdePkg/Libr= ary/UefiRuntimeLib/UefiRuntimeLib.inf index d053da545a..8f46495fc5 100644 --- a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf +++ b/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf @@ -5,7 +5,7 @@ # EVT_SIGNAL_EXIT_BOOT_SERVICES event, to provide runtime services. # This instance also supports SAL drivers for better performance. # -# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -24,7 +24,7 @@ [Defines] FILE_GUID =3D b1ee6c28-54aa-4d17-b705-3e28ccb27b2e MODULE_TYPE =3D DXE_RUNTIME_DRIVER VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D UefiRuntimeLib|DXE_RUNTIME_DRIVER DXE= _SAL_DRIVER DXE_CORE DXE_DRIVER DXE_SMM_DRIVER=20 + LIBRARY_CLASS =3D UefiRuntimeLib|DXE_RUNTIME_DRIVER DXE= _SAL_DRIVER =20 CONSTRUCTOR =3D RuntimeDriverLibConstruct DESTRUCTOR =3D RuntimeDriverLibDeconstruct --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel