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.web11.71735.1629391990868568120 for ; Thu, 19 Aug 2021 09:53:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=eyzFtGka; 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 1464F20C33B1; Thu, 19 Aug 2021 09:53:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1464F20C33B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1629391990; bh=3Ns/SmQw8HAo6YlxMq0zV8eSQJ2kYCddhD0OkASl3c4=; h=Subject:To:References:From:Date:In-Reply-To:From; b=eyzFtGkaHo2F1Q3yKo49xPPlVH1WzvSXbflNMeJaOJFtFkwkpz+PHSUL/AhpB3ev7 IamXVcXtAnI9zJzt6W3yGvDgvTKOph7xiK3ZV6fhh7igB9rZ+kn8fUbIKxcOYob2vn cKqefjMdFMns8Db+CnnhBc27i99z9WbfPXuNmA6s= 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> From: "Michael Kubacki" Message-ID: <28669d2c-da78-d35f-4ad3-812a70d09ba2@linux.microsoft.com> Date: Thu, 19 Aug 2021 12:53:09 -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 I don't understand your argument. The library class (SmmAccessLib) that already exists is the abstraction=20 layer. This is not introducing a new layer of abstraction. It is using=20 the current layer of abstraction. Thanks, Michael On 8/19/2021 5:49 AM, Ni, Ray wrote: > Michael, >=20 > I don=E2=80=99t think scenario #1 is a good reason for NULL instance of= =20 > SmmAccessLib. The root cause is BoardInitLib lib class supports pre-mem= =20 > and post-mem board init. >=20 > Below solution can avoid NULL SmmAccessLib: >=20 > Create two instances of BoardInitLib for pre-mem and post-mem. Pre-mem=20 > one doesn=E2=80=99t link to SmmAccessLib. >=20 > For scenario #2, if a particular platform doesn=E2=80=99t support S3, why= does=20 > this platform include the PEIM? >=20 > Please understand that I want to avoid introducing more abstraction layer= s. >=20 > Thanks, >=20 > Ray >=20 > *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]=20 > IntelSiliconPkg: Add BaseSmmAccessLibNull >=20 > Sure. >=20 > Scenario #1: >=20 > MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf and=20 > MinPlatormPkg/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf both= =20 > link against an instance of BoardInitLib. >=20 > Many boards link against a single BoardInitLib instance. See example -=20 > https://github.com/tianocore/edk2-platforms/blob/cd4e6b716c7d1bcde94035e7= dce14b53a553e103/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoard= Pkg.dsc#L203=20 > >=20 > That BoardInitLib instance may link against SmmAccessLib.=20 > PlatformInitPreMem may wish to library class override the SmmAccessLib=20 > to the NULL instance while keeping it to non-NULL instance in=20 > PlatformInitPostMem. >=20 > Scenario #2: >=20 > A PEIM is built that checks whether the boot mode is S3. If so, it calls= =20 > PeiInstallSmmAccessPpi(). A particular platform does not support S3,=20 > therefore, it links BaseSmmAccessLibNull as its library instance for=20 > SmmAccessLib. >=20 >=20