public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Liu, Zhiguang" <zhiguang.liu@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>
Subject: Re: [PATCH 3/5] SimicsOpenBoardPkg: Use SmmAccessLib instead of SmmAccessPei.inf
Date: Tue, 25 Apr 2023 13:55:56 +0000	[thread overview]
Message-ID: <MN6PR11MB82447C0BA52B998DF5758B6E8C649@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230425070304.2120-4-zhiguang.liu@intel.com>

Can you fix some typos in the commit message?
With that, Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Liu, Zhiguang <zhiguang.liu@intel.com>
> Sent: Tuesday, April 25, 2023 3:03 PM
> To: devel@edk2.groups.io
> Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH 3/5] SimicsOpenBoardPkg: Use SmmAccessLib instead of
> SmmAccessPei.inf
> 
> SmmAccessPei.inf is a PEIM we should deleted, here is the reason:
> 1. It programs registers MCH_TOLUD to set the Low Usable DRAM,
> but reading LMCH_TOLUD always return zere in QSP platforms
> 2. It programs/reads MCH_TSEGMB to implemte some Smm Access service
> such as open/close/lock. However, this reading LMCH_TOLUD also always
> return zere in QSP platforms
> 3. It returns the hard-code Smm range information. However, there are
> two improper things about this. One is that we already have the hard
> code value about T-Seg base/size in MemDetect. The other Smm range
> informaton is already saved in gEfiSmmSmramMemoryGuid Hob. No need
> hard-code value.
> 
> So, this patch uses another way, calling PeiInstallSmmAccessPpi from
> SmmAccessLib. The lib instance we choose will use the
> gEfiSmmSmramMemoryGuid Hob information.
> In a word, with the patch, we can avoid additional hard-code, and
> avoid programing unimplemented registers.
> 
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
>  .../SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc    | 7 +------
>  .../SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf    | 1 -
>  Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c  | 9
> +++++++++
>  .../Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf     | 2 ++
>  4 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> index 7b98baf764..fcae343146 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> @@ -142,6 +142,7 @@
>    # Silicon Package
>    #####################################
> 
> ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLi
> b.inf
> +
> SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi
> b/PeiSmmAccessLib.inf
> 
>    #####################################
>    # Platform Package
> @@ -190,12 +191,6 @@
>    #######################################
>    # Silicon Initialization Package
>    #######################################
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
> -  $(SKT_PKG)/Smm/Access/SmmAccessPei.inf {
> -    <LibraryClasses>
> -      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
> -  }
> -!endif
> 
>    #####################################
>    # Platform Package
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> index 221706ae03..844f9b6dcf 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf
> @@ -165,7 +165,6 @@ INF
> MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf
>  !include MinPlatformPkg/Include/Fdf/CoreSecurityPostMemoryInclude.fdf
> 
>  INF  UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
> -INF  $(SKT_PKG)/Smm/Access/SmmAccessPei.inf
>  # S3 SMM PEI driver
>  #INF  UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf
> 
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c
> b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c
> index 13ee415f40..f9a5487365 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c
> +++ b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c
> @@ -25,6 +25,7 @@
>  #include <Library/CmosAccessLib.h>
>  #include <SimicsPlatforms.h>
>  #include <Guid/SmramMemoryReserve.h>
> +#include <Library/SmmAccessLib.h>
> 
>  #include <CmosMap.h>
> 
> @@ -472,6 +473,8 @@ InitializeRamRegions (
>    VOID
>    )
>  {
> +  EFI_STATUS     Status;
> +
>    QemuInitializeRam ();
> 
>    if (mS3Supported && mBootMode != BOOT_ON_S3_RESUME) {
> @@ -544,4 +547,10 @@ InitializeRamRegions (
>          );
>      }
>    }
> +
> +  //
> +  // Install EFI_PEI_MM_ACCESS_PPI for S3 resume case
> +  //
> +  Status = PeiInstallSmmAccessPpi ();
> +  ASSERT_EFI_ERROR (Status);
>  }
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf
> b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf
> index 618ad4075f..cdc30ad582 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf
> +++ b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf
> @@ -36,6 +36,7 @@
>    SimicsX58SktPkg/SktPkg.dec
>    SimicsIch10Pkg/Ich10Pkg.dec
>    BoardModulePkg/BoardModulePkg.dec
> +  IntelSiliconPkg/IntelSiliconPkg.dec
> 
>  [Guids]
>    gEfiMemoryTypeInformationGuid
> @@ -55,6 +56,7 @@
>    MtrrLib
>    PcdLib
>    CmosAccessLib
> +  SmmAccessLib
> 
>  [Pcd]
>    gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsPeiMemFvBase
> --
> 2.31.1.windows.1


  reply	other threads:[~2023-04-25 13:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25  7:02 [PATCH 0/5] refine Smm range code in BoardX58Ich10 Zhiguang Liu
2023-04-25  7:03 ` [PATCH 1/5] SimicsOpenBoardPkg: Build gEfiSmmSmramMemoryGuid Hob in S3 path Zhiguang Liu
2023-04-25 13:48   ` Ni, Ray
     [not found]   ` <175931AA7778970F.7408@groups.io>
2023-04-25 13:51     ` [edk2-devel] " Ni, Ray
2023-04-25  7:03 ` [PATCH 2/5] SimicsOpenBoardPkg: Move AcpiVariableGuid hob to MemDetect Zhiguang Liu
2023-04-25 13:53   ` [edk2-devel] " Ni, Ray
2023-04-25  7:03 ` [PATCH 3/5] SimicsOpenBoardPkg: Use SmmAccessLib instead of SmmAccessPei.inf Zhiguang Liu
2023-04-25 13:55   ` Ni, Ray [this message]
2023-04-25  7:03 ` [PATCH 4/5] SimicsOpenBoardPkg: Use another SmmAccess Driver Zhiguang Liu
2023-04-25 13:57   ` Ni, Ray
2023-04-25  7:03 ` [PATCH 5/5] SimicsX58SktPkg: Remove unused Smm related modules Zhiguang Liu
2023-04-25 13:58   ` Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN6PR11MB82447C0BA52B998DF5758B6E8C649@MN6PR11MB8244.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox