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.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org 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 2DDE1209831C6 for ; Wed, 5 Sep 2018 19:33:40 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2018 19:33:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,334,1531810800"; d="scan'208";a="86397914" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.8]) ([10.239.9.8]) by fmsmga004.fm.intel.com with ESMTP; 05 Sep 2018 19:33:25 -0700 To: Andrew Fish , Laszlo Ersek Cc: Leif Lindholm , edk2-devel@lists.01.org, Jaben Carsey , Alexander Graf , Heinrich Schuchardt , AKASHI Takahiro , Mike Kinney References: <20180905172546.hxc2vqn6pgmr2zqs@bivouac.eciton.net> <8f700131-c4da-59bf-e1d3-0f4000e65215@redhat.com> <4C4EEEA0-8656-49D5-9DEE-8A810F6D8FC2@apple.com> From: "Ni, Ruiyu" Message-ID: <14abfd24-94eb-53f0-8ed6-721cbbc55137@Intel.com> Date: Thu, 6 Sep 2018 10:34:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <4C4EEEA0-8656-49D5-9DEE-8A810F6D8FC2@apple.com> Subject: Re: portability of ShellPkg X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2018 02:33:41 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 9/6/2018 3:47 AM, Andrew Fish wrote: > > Laszlo, > > gEfiMemoryTypeInformationGuid is an edk2/MdeModulePkg concept used to > give the DXE Core hints on how to reduce fragmentation in the memory > map. Typically there is code in PEI that creates a HOB and may consume a > variable written by the BDS. This library seems to be the generic way to > do it on an edk2 platform. > > Thus this library is not just PI but edk2 MdeModulePkg specific in some > of its assumptions. In general this UefiBootManagerLib seems focused on > construction and edk2 BDS. It would probably make more sense to break > out the UEFI Spec related bits so they could be used in generic UEFI > Applications. > > Thanks, > > Andrew Fish > > Andrew, I agree refactoring UefiBootManagerLib to separate the pure UEFI, pure PI and EDKII specific looks much more cleaner. So far the PI related bits in UefiBootManagerLib may include: 1. Hob access for S4 support (memory type information HOB). 2. Boot from Firmware Volume support. But that requires introducing two or more library classes so affecting all existing platforms. EfiCreateEventLegacyBootEx() in UefiLib also touches PI event gEfiEventLegacyBootGuid. And I think the value of refactor might be small. I think root cause of this problem is not UefiBootManagerLib includes PI, it's the assertion in DxeHobLib. So I am thinking maybe a very light fix is to remove the constructor of DxeHobLib. I talked with Liming about this and he suggested that instead of removing the constructor, it's safer to just remove the assertion in the constructor. Because removing the constructor of HobLib may cause AutoGen process generates a different order of library constructors calling sequence, which may break the platform. So I propose to just remove the assertion in DxeHobLib constructor. Thoughts? -- Thanks, Ray