[edk2-devel] [PATCH v3 16/18] UefiCpuPkg: CpuIo2Smm: Move CpuIo2Smm driver to consume gMmst

Ni, Ray ray.ni at intel.com
Fri Jan 22 04:18:11 UTC 2021


Reviewed-by: Ray Ni <ray.ni at intel.com>

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Laszlo
> Ersek
> Sent: Friday, January 15, 2021 3:12 PM
> To: Kun Qin <kun.q at outlook.com>; devel at edk2.groups.io
> Cc: Dong, Eric <eric.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Kumar,
> Rahul1 <rahul1.kumar at intel.com>
> Subject: Re: [edk2-devel] [PATCH v3 16/18] UefiCpuPkg: CpuIo2Smm: Move
> CpuIo2Smm driver to consume gMmst
> 
> On 01/14/21 23:36, Kun Qin wrote:
> > This change replaced gSmst with gMmst to support broader compatibility
> > under MM environment for CpuIo2Smm driver.
> >
> > Cc: Eric Dong <eric.dong at intel.com>
> > Cc: Ray Ni <ray.ni at intel.com>
> > Cc: Laszlo Ersek <lersek at redhat.com>
> > Cc: Rahul Kumar <rahul1.kumar at intel.com>
> >
> > Signed-off-by: Kun Qin <kun.q at outlook.com>
> > ---
> >
> > Notes:
> >     v3:
> >     - Break gMmst replacement into separate PR [Laszlo]
> >
> >     v2:
> >     - Removed "EFIAPI" for internal functions.
> >
> >  UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c   | 6 +++---
> >  UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h   | 2 +-
> >  UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf | 2 +-
> >  UefiCpuPkg/UefiCpuPkg.dsc          | 1 +
> >  4 files changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
> b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
> > index b840d3e10cae..c0a2baecee03 100644
> > --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
> > +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
> > @@ -390,12 +390,12 @@ SmmCpuIo2Initialize (
> >    //
> >    // Copy the SMM CPU I/O Protocol instance into the System Management
> System Table
> >    //
> > -  CopyMem (&gSmst->SmmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2));
> > +  CopyMem (&gMmst->MmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2));
> >
> >    //
> > -  // Install the SMM CPU I/O Protocol into the SMM protocol database
> > +  // Install the SMM CPU I/O Protocol into the MM protocol database
> >    //
> > -  Status = gSmst->SmmInstallProtocolInterface (
> > +  Status = gMmst->MmInstallProtocolInterface (
> >                      &mHandle,
> >                      &gEfiSmmCpuIo2ProtocolGuid,
> >                      EFI_NATIVE_INTERFACE,
> > diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h
> b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h
> > index 4c133b58c9f4..c80261945f71 100644
> > --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h
> > +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h
> > @@ -16,7 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> >  #include <Library/BaseLib.h>
> >  #include <Library/DebugLib.h>
> >  #include <Library/IoLib.h>
> > -#include <Library/SmmServicesTableLib.h>
> > +#include <Library/MmServicesTableLib.h>
> >  #include <Library/BaseMemoryLib.h>
> >
> >  #define MAX_IO_PORT_ADDRESS   0xFFFF
> > diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> > index bc78fa4e42d2..b743a5e0e316 100644
> > --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> > +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
> > @@ -34,7 +34,7 @@ [LibraryClasses]
> >    BaseLib
> >    DebugLib
> >    IoLib
> > -  SmmServicesTableLib
> > +  MmServicesTableLib
> >    BaseMemoryLib
> >
> >  [Protocols]
> > diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
> > index b2b6d78a71b0..9b56bcaabebe 100644
> > --- a/UefiCpuPkg/UefiCpuPkg.dsc
> > +++ b/UefiCpuPkg/UefiCpuPkg.dsc
> > @@ -89,6 +89,7 @@ [LibraryClasses.common.DXE_DRIVER]
> >
> >  [LibraryClasses.common.DXE_SMM_DRIVER]
> >
> SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTab
> leLib.inf
> > +
> MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableL
> ib.inf
> >
> MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemor
> yAllocationLib.inf
> >    HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> >
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCp
> uExceptionHandlerLib.inf
> >
> 
> Reviewed-by: Laszlo Ersek <lersek at redhat.com>
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#70663): https://edk2.groups.io/g/devel/message/70663
Mute This Topic: https://groups.io/mt/79688597/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list