Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>

On 2015-11-03 13:00:46, Laszlo Ersek wrote:
> "MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf" (a DXE_RUNTIME_DRIVER)
> implements the SMM Initial Program Loader. It produces
> EFI_SMM_BASE2_PROTOCOL and EFI_SMM_COMMUNICATION_PROTOCOL, relying on:
> - EFI_SMM_ACCESS2_PROTOCOL
>   (provided by OvmfPkg/SmmAccess/SmmAccess2Dxe.inf),
> - EFI_SMM_CONTROL2_PROTOCOL
>   (provided by OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf).
> 
> (The SMM IPL also depends on EFI_SMM_CONFIGURATION_PROTOCOL_GUID, but this
> dependency is not enforced in the entry point. A protocol notify callback
> is registered instead, hence we can delay providing that protocol via the
> PiSmmCpuDxeSmm driver that is (to be) imported from
> Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/.)
> 
> The SMM IPL loads the SMM core into SMRAM and executes it from there.
> Therefore we add the SMM core to the build as well.
> 
> For the SMM core, a number of library classes need to be resolved.
> Furthermore, each FDF file must provide the GenFds.py BaseTools utility
> with a build rule for SMM_CORE; we copy the DXE_CORE's rule.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek <ler...@redhat.com>
> ---
>  OvmfPkg/OvmfPkgIa32.dsc    | 21 ++++++++++++++++++++
>  OvmfPkg/OvmfPkgIa32X64.dsc | 21 ++++++++++++++++++++
>  OvmfPkg/OvmfPkgX64.dsc     | 21 ++++++++++++++++++++
>  OvmfPkg/OvmfPkgIa32.fdf    |  9 +++++++++
>  OvmfPkg/OvmfPkgIa32X64.fdf |  9 +++++++++
>  OvmfPkg/OvmfPkgX64.fdf     |  9 +++++++++
>  6 files changed, 90 insertions(+)
> 
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index c71a2f4..ca3be30 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -296,6 +296,17 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
>  [LibraryClasses.common.SMM_CORE]
>    PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
>    TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
> +  
> SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf
> +  
> MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf
> +  
> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
> +  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> +  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
> +  
> SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf
> +!ifdef $(DEBUG_ON_SERIAL_PORT)
> +  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
> +!else
> +  DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
> +!endif
>  
>  
> ################################################################################
>  #
> @@ -676,4 +687,14 @@ [Components]
>  !if $(SMM_REQUIRE) == TRUE
>    OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
>    OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> +
> +  #
> +  # SMM Initial Program Load (a DXE_RUNTIME_DRIVER)
> +  #
> +  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> +
> +  #
> +  # SMM_CORE
> +  #
> +  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>  !endif
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index a1e8f0d..60f085a 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -301,6 +301,17 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
>  [LibraryClasses.common.SMM_CORE]
>    PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
>    TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
> +  
> SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf
> +  
> MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf
> +  
> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
> +  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> +  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
> +  
> SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf
> +!ifdef $(DEBUG_ON_SERIAL_PORT)
> +  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
> +!else
> +  DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
> +!endif
>  
>  
> ################################################################################
>  #
> @@ -683,4 +694,14 @@ [Components.X64]
>  !if $(SMM_REQUIRE) == TRUE
>    OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
>    OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> +
> +  #
> +  # SMM Initial Program Load (a DXE_RUNTIME_DRIVER)
> +  #
> +  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> +
> +  #
> +  # SMM_CORE
> +  #
> +  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>  !endif
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index 1176629..0621292 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -301,6 +301,17 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
>  [LibraryClasses.common.SMM_CORE]
>    PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
>    TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
> +  
> SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf
> +  
> MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf
> +  
> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
> +  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> +  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
> +  
> SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf
> +!ifdef $(DEBUG_ON_SERIAL_PORT)
> +  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
> +!else
> +  DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
> +!endif
>  
>  
> ################################################################################
>  #
> @@ -681,4 +692,14 @@ [Components]
>  !if $(SMM_REQUIRE) == TRUE
>    OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
>    OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> +
> +  #
> +  # SMM Initial Program Load (a DXE_RUNTIME_DRIVER)
> +  #
> +  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> +
> +  #
> +  # SMM_CORE
> +  #
> +  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>  !endif
> diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
> index 43c9c30..f705918 100644
> --- a/OvmfPkg/OvmfPkgIa32.fdf
> +++ b/OvmfPkg/OvmfPkgIa32.fdf
> @@ -358,6 +358,8 @@ [FV.DXEFV]
>  !if $(SMM_REQUIRE) == TRUE
>  INF  OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
>  INF  OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> +INF  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> +INF  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>  !endif
>  
>  
> ################################################################################
> @@ -486,3 +488,10 @@ [Rule.Common.SEC.RESET_VECTOR]
>    FILE RAW = $(NAMED_GUID) {
>      RAW BIN   Align = 16   |.bin
>    }
> +
> +[Rule.Common.SMM_CORE]
> +  FILE SMM_CORE = $(NAMED_GUID) {
> +    PE32     PE32           $(INF_OUTPUT)/$(MODULE_NAME).efi
> +    UI       STRING="$(MODULE_NAME)" Optional
> +    VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
> +  }
> diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
> index 9446896..93a8d44 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.fdf
> +++ b/OvmfPkg/OvmfPkgIa32X64.fdf
> @@ -358,6 +358,8 @@ [FV.DXEFV]
>  !if $(SMM_REQUIRE) == TRUE
>  INF  OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
>  INF  OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> +INF  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> +INF  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>  !endif
>  
>  
> ################################################################################
> @@ -486,3 +488,10 @@ [Rule.Common.SEC.RESET_VECTOR]
>    FILE RAW = $(NAMED_GUID) {
>      RAW BIN   Align = 16   |.bin
>    }
> +
> +[Rule.Common.SMM_CORE]
> +  FILE SMM_CORE = $(NAMED_GUID) {
> +    PE32     PE32           $(INF_OUTPUT)/$(MODULE_NAME).efi
> +    UI       STRING="$(MODULE_NAME)" Optional
> +    VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
> +  }
> diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
> index b272b76..3c24aed 100644
> --- a/OvmfPkg/OvmfPkgX64.fdf
> +++ b/OvmfPkg/OvmfPkgX64.fdf
> @@ -358,6 +358,8 @@ [FV.DXEFV]
>  !if $(SMM_REQUIRE) == TRUE
>  INF  OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
>  INF  OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
> +INF  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> +INF  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
>  !endif
>  
>  
> ################################################################################
> @@ -486,3 +488,10 @@ [Rule.Common.SEC.RESET_VECTOR]
>    FILE RAW = $(NAMED_GUID) {
>      RAW BIN   Align = 16   |.bin
>    }
> +
> +[Rule.Common.SMM_CORE]
> +  FILE SMM_CORE = $(NAMED_GUID) {
> +    PE32     PE32           $(INF_OUTPUT)/$(MODULE_NAME).efi
> +    UI       STRING="$(MODULE_NAME)" Optional
> +    VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
> +  }
> -- 
> 1.8.3.1
> 
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to