From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0704.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe48::704]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 079971A1DF7 for ; Fri, 30 Sep 2016 15:04:32 -0700 (PDT) Received: from AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM (10.162.138.25) by AT5PR84MB0289.NAMPRD84.PROD.OUTLOOK.COM (10.162.138.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16; Fri, 30 Sep 2016 22:04:31 +0000 Received: from AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM ([10.162.138.25]) by AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM ([10.162.138.25]) with mapi id 15.01.0639.015; Fri, 30 Sep 2016 22:04:31 +0000 From: "Cohen, Eugene" To: 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: AdIbIt8zDF4zYVg0Qm6BbTDEpt2HcgAA5RyAAARYvtAAAp28gAAI576g Date: Fri, 30 Sep 2016 22:04:30 +0000 Message-ID: References: <9877647c-b348-2a36-9ac0-b520a82260d1@redhat.com> <654a587b-8f79-51ef-8ba9-a29779de46c9@redhat.com> In-Reply-To: <654a587b-8f79-51ef-8ba9-a29779de46c9@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=eugene@hp.com; x-originating-ip: [15.65.252.13] x-ms-office365-filtering-correlation-id: 9de3abb9-5e78-4bec-74fa-08d3e97dc138 x-microsoft-exchange-diagnostics: 1; AT5PR84MB0289; 6:NIVj5KMJY5M2qOYkSyoiKQbuDVbYkdPtzADKBye8gknQ8AxlnYf/RiQ9GyJK+JHJvS+qzlRFuEBIAVyGFMhnE97f7rjUyIQzMYLItiX5SQGGtfVYQcsnO2Q2CgQ4VRrxv3qZ1bYe3ReE6nDjPluxGVozveX/Z02wskBdk0nbYtQT9OQkr4ApVPoezA5rR3C/kVEcDsv331EYJrWLqeByOB4kJdchilSCvQaqJDy5zVnSSXrgNssaAy1b51kbHpIFfKU83H7cYJqPt97z/w8DQ3GjDJ5ssyE67TsRtyTy9o9aMQJ0bkuYjppqywmKY+oi; 5:zxKhdZcmnO8DiUfzs/CExXgOkqRF/t6qkJWxOXcwMan2KLrh/Iuzapn0IFykaii70hsf2MX+A1/RHSTF/1B70zZ2r0T2FNgVm5BVyATAo79FzxMEHrqqJjnjY3Xj8+ANYnpB/ifhgcifb+QzqPWOGkfKr+rksYIHl9EQdkhl5/M=; 24:ONcdhT5HhmyurRwddN7VHMKAk1lutGtvv85zMqVtWwaglDj19w4jgbBF77uqhaPsQs73KASQYgY3xHoM/D2OtpE6x4He9oov2B8s3/FoXfU=; 7:jG8K2ylEPp4QzMtjPxobgt/samGVKxVM/tD/XiPw2zjE+eBGz+zYv1r6qaVyJX0NDEu27eguK4Ki8En8uO0wZpT5iblKnvRfgQnf2wLAu/cUs7pk8faVQAu40mhABCm2MJzqB7cAMi7W3a3fcxLSZrQtI0iKY84PLrFmG32jKOlwtaOQLSlTO1nRdQ0cRVl3AsNY3n83+qw7bHW4B15A6FKNcrpO1ieVCqBnofuP88aHEFms6DrakOQP0I9g1P9Z7vuqkuWVAnIJ0XV4dgKLmI7LE4fE+geM3V8LllAgY6/3NHHF3Jbyr3MYH3S3qlhFFI4ZxZ8VQ85+VbYcnJLLaw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AT5PR84MB0289; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:AT5PR84MB0289; BCL:0; PCL:0; RULEID:; SRVR:AT5PR84MB0289; x-forefront-prvs: 008184426E x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(199003)(189002)(6602003)(86362001)(6116002)(3846002)(102836003)(93886004)(586003)(9686002)(106356001)(76176999)(105586002)(54356999)(5002640100001)(99286002)(101416001)(66066001)(10400500002)(50986999)(3280700002)(74316002)(5660300001)(77096005)(7846002)(122556002)(2906002)(7736002)(2950100002)(8936002)(2900100001)(305945005)(8666005)(81156014)(7696004)(81166006)(8676002)(189998001)(68736007)(92566002)(97736004)(3660700001)(107886002)(87936001)(33656002)(5001770100001)(11100500001)(7059030)(491001); DIR:OUT; SFP:1102; SCL:1; SRVR:AT5PR84MB0289; H:AT5PR84MB0291.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: hp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2016 22:04:30.9226 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: ca7981a2-785a-463d-b82a-3db87dfc3ce6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR84MB0289 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: Fri, 30 Sep 2016 22:04:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable > 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 us= e case I'm trying to enable here (and I would argue as an industry is a pra= ctice 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 ap= proach for a ProtocolLib implementation. Thanks, great feedback. Eugene