From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 2212321114789 for ; Fri, 1 Jun 2018 02:24:54 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jun 2018 02:24:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,465,1520924400"; d="scan'208";a="45614824" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga007.jf.intel.com with ESMTP; 01 Jun 2018 02:24:53 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 1 Jun 2018 02:24:53 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 1 Jun 2018 02:24:52 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.87]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Fri, 1 Jun 2018 17:24:51 +0800 From: "Gao, Liming" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [PATCH 3/3] MdePkg/UefiRuntimeLib: Do not allow to be linked by DXE driver Thread-Index: AQHT+XlBoB6Jsqod30KkeRivXzzts6RLIcwg Date: Fri, 1 Jun 2018 09:24:50 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E29199F@SHSMSX104.ccr.corp.intel.com> References: <20180601072212.99856-1-ruiyu.ni@intel.com> <20180601072212.99856-4-ruiyu.ni@intel.com> In-Reply-To: <20180601072212.99856-4-ruiyu.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmQ3YjA1OTItMzU3NC00M2E1LWEzNTktYWU0ZWIzMDJhN2U0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWkREZXJnNGNaS1wvMCszZnR4SjN4RDl4QmwwTVBZcXNGY3BrZnM3cUE4XC94U1k3WFNhSzAxOWFcL2VwZ0FkdVRxcSJ9 dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Fri, 01 Jun 2018 09:24:54 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Ni, Ruiyu > Sent: Friday, June 1, 2018 3:22 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming ; Zeng, Star > Subject: [PATCH 3/3] MdePkg/UefiRuntimeLib: Do not allow to be linked by = DXE driver >=20 > 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. >=20 > The patch reverts commit 97511979b4fdd84cf7cd51e43c22dc03e79bd4f3 > "MdePkg/UefiRuntimeLib: Support more module types." > It makes sure that DXE driver cannot link to this library. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ruiyu Ni > Cc: Liming Gao > Cc: Star Zeng > --- > MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf b/MdePkg/Li= brary/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= BSD License > @@ -24,7 +24,7 @@ [Defines] > FILE_GUID =3D b1ee6c28-54aa-4d17-b705-3e28ccb27b2= e > MODULE_TYPE =3D DXE_RUNTIME_DRIVER > VERSION_STRING =3D 1.0 > - LIBRARY_CLASS =3D UefiRuntimeLib|DXE_RUNTIME_DRIVER D= XE_SAL_DRIVER DXE_CORE DXE_DRIVER > DXE_SMM_DRIVER > + LIBRARY_CLASS =3D UefiRuntimeLib|DXE_RUNTIME_DRIVER D= XE_SAL_DRIVER >=20 > CONSTRUCTOR =3D RuntimeDriverLibConstruct > DESTRUCTOR =3D RuntimeDriverLibDeconstruct > -- > 2.16.1.windows.1