On 2016-07-13 07:36:58, Laszlo Ersek wrote:
> In the next patch we're going to put EFI_PEI_MP_SERVICES_PPI to use.
> 
> CpuMpPei uses the following PCDs from gUefiCpuPkgTokenSpaceGuid, beyond
> those already used by CpuDxe:
> 
> - PcdCpuMicrocodePatchAddress and PcdCpuMicrocodePatchRegionSize: these
>   control whether CpuMpPei performs microcode update. If the region size
>   is zero, then the microcode update is skipped. UefiCpuPkg.dec sets the
>   region size to zero by default, which is appropriate for OVMF.
> 
> - PcdCpuApLoopMode and PcdCpuApTargetCstate: the former controls how
>   CpuMpPei puts the APs to sleep: 1 -- HLT, 2 -- MWAIT, 3 -- busy wait
>   (with PAUSE). The latter PCD is only relevant if the former PCD is 2
>   (MWAIT). In order to be consistent with SeaBIOS and with CpuDxe itself,
>   we choose HLT. That's the default set by UefiCpuPkg.dec.
> 
> Furthermore, although CpuMpPei could consume SecPeiCpuExceptionHandlerLib
> technically, it is supposed to consume PeiCpuExceptionHandlerLib. See:
> 
> - http://thread.gmane.org/gmane.comp.bios.edk2.devel/12703
> 
> - git commit a81abf161666 ("UefiCpuPkg/ExceptionLib: Import
>   PeiCpuExceptionHandlerLib module"), part of the series linked above.
> 
> Jeff recommended to resolve CpuExceptionHandlerLib to
> PeiCpuExceptionHandlerLib for all PEIMs:
> 
> - http://thread.gmane.org/gmane.comp.bios.edk2.devel/14471/focus=14477
> 
> Since at the moment we have no resolution in place that would cover this
> for PEIMs (from either [LibraryClasses] or [LibraryClasses.common.PEIM]),
> it's easy to do.
> 
> Cc: Jeff Fan <jeff....@intel.com>
> Cc: Jordan Justen <jordan.l.jus...@intel.com>
> Cc: Michael Kinney <michael.d.kin...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek <ler...@redhat.com>
> ---
> 
> Notes:
>     v3:
>     - resolve CpuExceptionHandlerLib to PeiCpuExceptionHandlerLib for all
>       PEIMs [Jeff]
>     - drop Jeff's R-b from earlier
> 
>  OvmfPkg/OvmfPkgIa32.dsc    | 5 +++++
>  OvmfPkg/OvmfPkgIa32X64.dsc | 5 +++++
>  OvmfPkg/OvmfPkgX64.dsc     | 5 +++++
>  OvmfPkg/OvmfPkgIa32.fdf    | 1 +
>  OvmfPkg/OvmfPkgIa32X64.fdf | 1 +
>  OvmfPkg/OvmfPkgX64.fdf     | 1 +
>  6 files changed, 18 insertions(+)
> 
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index 805650059e96..8af326778205 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -212,6 +212,7 @@ [LibraryClasses.common.PEIM]
>  !ifdef $(SOURCE_DEBUG_ENABLE)
>    
> DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
>  !endif
> +  
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
>  
>  [LibraryClasses.common.DXE_CORE]
>    HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
> @@ -519,6 +520,10 @@ [Components]
>        PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
>    }
>  !endif
> +  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {
> +    <LibraryClasses>
> +      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
> +  }

It looks like we have this (PcdLib) overridden in nearly every PEIM. I
think we should update the default library mapping.

With, or without that change:
Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>

>  
>    #
>    # DXE Phase modules
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index 7615ee96dff2..4bb38d0f7b3c 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -217,6 +217,7 @@ [LibraryClasses.common.PEIM]
>  !ifdef $(SOURCE_DEBUG_ENABLE)
>    
> DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
>  !endif
> +  
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
>  
>  [LibraryClasses.common.DXE_CORE]
>    HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
> @@ -527,6 +528,10 @@ [Components.IA32]
>        PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
>    }
>  !endif
> +  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {
> +    <LibraryClasses>
> +      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
> +  }
>  
>  [Components.X64]
>    #
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index 7f8a5c25a5c0..be3aa1fc6c43 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -217,6 +217,7 @@ [LibraryClasses.common.PEIM]
>  !ifdef $(SOURCE_DEBUG_ENABLE)
>    
> DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
>  !endif
> +  
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
>  
>  [LibraryClasses.common.DXE_CORE]
>    HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
> @@ -526,6 +527,10 @@ [Components]
>        PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
>    }
>  !endif
> +  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {
> +    <LibraryClasses>
> +      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
> +  }
>  
>    #
>    # DXE Phase modules
> diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
> index ccc3e1461d55..136973443755 100644
> --- a/OvmfPkg/OvmfPkgIa32.fdf
> +++ b/OvmfPkg/OvmfPkgIa32.fdf
> @@ -161,6 +161,7 @@ [FV.PEIFV]
>  !if $(SMM_REQUIRE) == TRUE
>  INF  OvmfPkg/SmmAccess/SmmAccessPei.inf
>  !endif
> +INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
>  
>  
> ################################################################################
>  
> diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
> index 3e368b42999f..34f8938adf82 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.fdf
> +++ b/OvmfPkg/OvmfPkgIa32X64.fdf
> @@ -161,6 +161,7 @@ [FV.PEIFV]
>  !if $(SMM_REQUIRE) == TRUE
>  INF  OvmfPkg/SmmAccess/SmmAccessPei.inf
>  !endif
> +INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
>  
>  
> ################################################################################
>  
> diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
> index f31afdb67359..630c2959ffbc 100644
> --- a/OvmfPkg/OvmfPkgX64.fdf
> +++ b/OvmfPkg/OvmfPkgX64.fdf
> @@ -161,6 +161,7 @@ [FV.PEIFV]
>  !if $(SMM_REQUIRE) == TRUE
>  INF  OvmfPkg/SmmAccess/SmmAccessPei.inf
>  !endif
> +INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
>  
>  
> ################################################################################
>  
> -- 
> 1.8.3.1
> 
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to