From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 255B21A1E24 for ; Sat, 8 Oct 2016 18:49:35 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 08 Oct 2016 18:49:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,315,1473145200"; d="scan'208,217";a="1067979145" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 08 Oct 2016 18:49:34 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 8 Oct 2016 18:49:34 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.15]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.234]) with mapi id 14.03.0248.002; Sun, 9 Oct 2016 09:49:32 +0800 From: "Gao, Liming" To: "Cohen, Eugene" , Laszlo Ersek , "edk2-devel@lists.01.org" , "Kinney, Michael D" , "Yao, Jiewen" , "Andrew Fish (afish@apple.com)" Thread-Topic: [edk2] RFC: ProtocolLib for cross DXE and SMM Protocol and Handle Services Thread-Index: AdIbIt8zDF4zYVg0Qm6BbTDEpt2Hcv//gQyAgAAkwoCAABLygIAASKEA//KqkQA= Date: Sun, 9 Oct 2016 01:49:31 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B4820B6@shsmsx102.ccr.corp.intel.com> References: <9877647c-b348-2a36-9ac0-b520a82260d1@redhat.com> <654a587b-8f79-51ef-8ba9-a29779de46c9@redhat.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGRjZGM0YTQtNzA0Ny00ZWIyLThmNDAtMDkwZjExMjJmMTkwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlQwcWc3S09wMFlGK3lXOThwUk1TNHZXa1pBcjRoQjYwSVJ3d3d2OElYdzQ9In0= x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: RFC: ProtocolLib for cross DXE and SMM Protocol and Handle Services X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 01:49:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Eugene: Could this library cover PEI PPI? LocatePpi and LocateProtocol both retur= n VOID**. And, I think this library class will include Install, Notify and = Locate APIs. Right? typedef EFI_STATUS (EFIAPI *EFI_PEI_LOCATE_PPI)( IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor OPTIONAL, IN OUT VOID **Ppi ); typedef EFI_STATUS (EFIAPI *EFI_LOCATE_PROTOCOL)( IN EFI_GUID *Protocol, IN VOID *Registration, OPTIONAL OUT VOID **Interface ); Thanks Liming From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Cohe= n, Eugene Sent: Saturday, October 1, 2016 6:05 AM To: Laszlo Ersek ; edk2-devel@lists.01.org ; Kinney, Michael D ; Yao, Jiewen ; Andrew Fish (afish@apple.com) Subject: Re: [edk2] RFC: ProtocolLib for cross DXE and SMM Protocol and Han= dle Services > I believe I understood this. However, in the entry point function of an > SMM driver, it is permitted to look for, and invoke member functions > of, > both SMM and DXE protocols [1]. If the library instance that is > supposed > to be linked into SMM drivers is tied to the SMM protocol database > solely, then it won't be able to serve the use case when an SMM driver > looks for a DXE protocol in its entry point function. Agreed - non-standalone SMM drivers (notice the new terminology I'm injecti= ng to prepare us for PI 1.5) can peek over at UEFI/DXE. This is not the use= case I'm trying to enable here (and I would argue as an industry is a prac= tice we will try to discourage over time). > ... Actually, I believe this applies even to MemoryAllocationLib. In an > SMM driver, the SMM-tailored MemoryAllocationLib instance only > allocates > SMRAM, which is mostly fine. However, it is unsuitable for allocating > (for example) EfiBootServicesData type memory, even though that too > is > permitted in the SMM driver's entry point function, I think. For that, > gBS->AllocatePool() or gBS->AllocatePages() have to be called > explicitly. Right - so the common library abstraction allocates from the "native" memor= y pool for the driver type and if you want something else you have to go ab= ove and beyond. So in the spirit of that precedent I'd propose the same app= roach for a ProtocolLib implementation. Thanks, great feedback. Eugene _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel