From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.8564.1631199264121511420 for ; Thu, 09 Sep 2021 07:54:24 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=CgznCflR; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [10.0.0.19] (c-73-27-179-174.hsd1.fl.comcast.net [73.27.179.174]) by linux.microsoft.com (Postfix) with ESMTPSA id 2DC0220B6C51; Thu, 9 Sep 2021 07:54:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2DC0220B6C51 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1631199263; bh=/lDSh6N/Y84FImvGG9b7dUGfy6OYbztM5/2yvF049qk=; h=Subject:To:References:From:Date:In-Reply-To:From; b=CgznCflRXjEyzNhTfnHqUnTR85v+hmZKXoh7BSVVcnVh43ZtPRslgBhUvQ4NaZmWY Wq1QW/a3/mofYAp5zg72jsoesX3Q4zRWIvKcGN6K6JmTUY5hfrQTkr9B3dSxkag2zk wWq6U6g5Nv0TLjj7O85jC462Lp0lDzpT/2EiC1+4= Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] IntelSiliconPkg: Add BaseSmmAccessLibNull To: devel@edk2.groups.io, ray.ni@intel.com References: <28423.1628820964257783330@groups.io> <28669d2c-da78-d35f-4ad3-812a70d09ba2@linux.microsoft.com> <66f3e7cf-7593-6c40-b7c3-091db4164c81@linux.microsoft.com> From: "Michael Kubacki" Message-ID: <5566a97f-43cb-5a8f-0942-7f66cc1ff19b@linux.microsoft.com> Date: Thu, 9 Sep 2021 10:54:22 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable So you would rather leave it as a library class instead of refactoring=20 it to a PEIM? Again, the problem is it is a library class. So I am asking whether you=20 want to treat it as a library class or you are going to refactor it to a=20 PEIM. On 9/9/2021 10:49 AM, Ni, Ray wrote: > No, I don't. > I still don't think having a NULL SmmAccessLib is a good idea. >=20 >> -----Original Message----- >> From: Michael Kubacki >> Sent: Thursday, September 9, 2021 10:12 PM >> To: Ni, Ray ; devel@edk2.groups.io >> Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] IntelSiliconPkg= : Add BaseSmmAccessLibNull >> >> Ray, >> >> Do you have plans to do something here? Whether take this patch or >> refactor SmmAccessLib to a PEIM? >> >> Thanks, >> Michael >> >> On 8/20/2021 3:34 PM, Michael Kubacki wrote: >>> Since you asked for an example that was just one that I provided. I >>> don't think it detracts from the fact that a NULL instance makes sense >>> if the SmmAccessLib library class exists. The fact that a NULL instance >>> could not be allowed to exist is also confusing. >>> >>> I don't want to get too distracted with the example given, but I >>> completely agree that a different library instance should be used for >>> pre-memory and post-memory. I think the library interface is too broad >>> in scope and that contributes to causing this issue so I filed this BZ >>> to request the BoardInitLib API be refactored: >>> https://bugzilla.tianocore.org/show_bug.cgi?id=3D3578 >>> >>> From the other email thread about SmmAccessLib, I think we are on the >>> same page that the library would be better as a PEIM. Is that something >>> that could be done soon? Or could we have this until that is done? >>> >>> Thanks, >>> Michael >>> >>> On 8/20/2021 1:33 AM, Ni, Ray wrote: >>>> Null SmmAccessLib is confusing to me. Have you evaluated the option: >>>> Create two instances of BoardInitLib for pre-mem and post-mem. Pre-mem >>>> one doesn=E2=80=99t link to SmmAccessLib >>>> >>>>> -----Original Message----- >>>>> From: devel@edk2.groups.io On Behalf Of >>>>> Michael Kubacki >>>>> Sent: Friday, August 20, 2021 12:53 AM >>>>> To: devel@edk2.groups.io; Ni, Ray >>>>> Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] >>>>> IntelSiliconPkg: Add BaseSmmAccessLibNull >>>>> >>>>> I don't understand your argument. >>>>> >>>>> The library class (SmmAccessLib) that already exists is the abstracti= on >>>>> layer. This is not introducing a new layer of abstraction. It is usin= g >>>>> the current layer of abstraction. >>>>> >>>>> Thanks, >>>>> Michael >>>>> >>>>> On 8/19/2021 5:49 AM, Ni, Ray wrote: >>>>>> Michael, >>>>>> >>>>>> I don=E2=80=99t think scenario #1 is a good reason for NULL instance= of >>>>>> SmmAccessLib. The root cause is BoardInitLib lib class supports pre-= mem >>>>>> and post-mem board init. >>>>>> >>>>>> Below solution can avoid NULL SmmAccessLib: >>>>>> >>>>>> Create two instances of BoardInitLib for pre-mem and post-mem. Pre-m= em >>>>>> one doesn=E2=80=99t link to SmmAccessLib. >>>>>> >>>>>> For scenario #2, if a particular platform doesn=E2=80=99t support S3= , why does >>>>>> this platform include the PEIM? >>>>>> >>>>>> Please understand that I want to avoid introducing more abstraction >>>>>> layers. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Ray >>>>>> >>>>>> *From:* Michael Kubacki >>>>>> *Sent:* Friday, August 13, 2021 10:16 AM >>>>>> *To:* Ni; Ni, Ray ; devel@edk2.groups.io >>>>>> *Subject:* Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] >>>>>> IntelSiliconPkg: Add BaseSmmAccessLibNull >>>>>> >>>>>> Sure. >>>>>> >>>>>> Scenario #1: >>>>>> >>>>>> MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf a= nd >>>>>> MinPlatormPkg/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf b= oth >>>>>> link against an instance of BoardInitLib. >>>>>> >>>>>> Many boards link against a single BoardInitLib instance. See example= - >>>>>> https://github.com/tianocore/edk2- >>>>> >> platforms/blob/cd4e6b716c7d1bcde94035e7dce14b53a553e103/Platform/Intel/K= abylakeOpenBoardPkg/KabylakeRvp3/OpenB >>>>> >>>>> oardPkg.dsc#L203 >>>>>> >>>> >> platforms/blob/cd4e6b716c7d1bcde94035e7dce14b53a553e103/Platform/Intel/K= abylakeOpenBoardPkg/KabylakeRvp3/OpenB >>>>> >>>>> oardPkg.dsc#L203> >>>>>> >>>>>> That BoardInitLib instance may link against SmmAccessLib. >>>>>> PlatformInitPreMem may wish to library class override the SmmAccessL= ib >>>>>> to the NULL instance while keeping it to non-NULL instance in >>>>>> PlatformInitPostMem. >>>>>> >>>>>> Scenario #2: >>>>>> >>>>>> A PEIM is built that checks whether the boot mode is S3. If so, it >>>>>> calls >>>>>> PeiInstallSmmAccessPpi(). A particular platform does not support S3, >>>>>> therefore, it links BaseSmmAccessLibNull as its library instance for >>>>>> SmmAccessLib. >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>> >=20 >=20 >=20 >=20 >=20