Message ID | 1468420619-19262-5-git-send-email-lersek@redhat.com |
---|---|
State | New |
Headers | show |
On 07/15/16 02:12, Jordan Justen wrote: > 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.fan@intel.com> >> Cc: Jordan Justen <jordan.l.justen@intel.com> >> Cc: Michael Kinney <michael.d.kinney@intel.com> >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Laszlo Ersek <lersek@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. Before posting this version of the series, I actually started writing that patch, but I abandoned it. I no longer remember why. I think the patch didn't save as much room in the DSC file as I hoped it would. I will post a follow-up patch so we can investigate this separately. > With, or without that change: > Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Thanks! Laszlo >> >> # >> # 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
On 07/15/16 07:18, Laszlo Ersek wrote: > On 07/15/16 02:12, Jordan Justen wrote: >> On 2016-07-13 07:36:58, Laszlo Ersek wrote: >>> 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. > > Before posting this version of the series, I actually started writing > that patch, but I abandoned it. I no longer remember why. I think the > patch didn't save as much room in the DSC file as I hoped it would. > > I will post a follow-up patch so we can investigate this separately. I remember now, after reviewing the build report file: Upon seeing those individual PcdLib resolutions, for almost every PEIM we have, I figured we should flip the [LibraryClasses] default to PeiPcdLib, from BasePcdLibNull. We have the following settings now: [LibraryClasses] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf [LibraryClasses.common] -- inherits the default -- [LibraryClasses.common.SEC] -- inherits the default -- [LibraryClasses.common.PEI_CORE] -- inherits the default -- [LibraryClasses.common.PEIM] -- inherits the default -- [LibraryClasses.common.DXE_CORE] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf [LibraryClasses.common.DXE_RUNTIME_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf [LibraryClasses.common.UEFI_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf [LibraryClasses.common.DXE_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf [LibraryClasses.common.UEFI_APPLICATION] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf [LibraryClasses.common.DXE_SMM_DRIVER] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf [LibraryClasses.common.SMM_CORE] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf In particular, after reviewing the build report file, the following modules use BasePcdLibNull: IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf MdeModulePkg/Core/Pei/PeiMain.inf MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf MdeModulePkg/Universal/PCD/Dxe/Pcd.inf MdeModulePkg/Universal/PCD/Pei/Pcd.inf OvmfPkg/Sec/SecMain.inf From these, DevicePathDxe and PCD/Dxe don't matter (they are DXE_DRIVER modules, they are covered by their [LibraryClasses.common.DXE_DRIVER] default, and must override that default unconditionally). So, we are left with 4 modules (1 SEC, 1 PEI_CORE, 2 PEIMs) that would have to override their inherited PcdLib resolution to BasePcdLibNull if we changed the [LibraryClasses] default to PeiPcdLib: - OvmfPkg/Sec/SecMain.inf - MdeModulePkg/Core/Pei/PeiMain.inf - MdeModulePkg/Universal/PCD/Pei/Pcd.inf - IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf This means 5 "compensatory" changes (*) in total (<LibraryClasses> for 4 modules, plus the [LibraryClasses] hunk), just so we can remove the current, explicit PeiPcdLib resolutions from 5 PEIMs: - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf - OvmfPkg/PlatformPei/PlatformPei.inf - UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf - OvmfPkg/SmmAccess/SmmAccessPei.inf - UefiCpuPkg/CpuMpPei/CpuMpPei.inf ((*) Well, PCD/Pei already spells out BasePcdLibNull, for no good reason (at the moment), so that wouldn't be a *change*, but it would be an override that would *remain* in the DSCs.) This looked like "churn for nothing": > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc > index 022661628dbe..c01bca9a2198 100644 > --- a/OvmfPkg/OvmfPkgX64.dsc > +++ b/OvmfPkg/OvmfPkgX64.dsc > @@ -68,7 +68,7 @@ [SkuIds] > ################################################################################ > [LibraryClasses] > HexDumpLib|OvmfPkg/Library/HexDumpLib/HexDumpLib.inf > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf > BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf > @@ -496,43 +496,36 @@ [Components] > OvmfPkg/Sec/SecMain.inf { > <LibraryClasses> > NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > } > > # > # PEI Phase modules > # > - MdeModulePkg/Core/Pei/PeiMain.inf > + MdeModulePkg/Core/Pei/PeiMain.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > MdeModulePkg/Universal/PCD/Pei/Pcd.inf { > <LibraryClasses> > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > } > - IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf > - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { > + IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf { > <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > - } > - > - OvmfPkg/PlatformPei/PlatformPei.inf { > - <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > } > + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > + OvmfPkg/PlatformPei/PlatformPei.inf > UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { > <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > !if $(SMM_REQUIRE) == TRUE > LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf > !endif > } > !if $(SMM_REQUIRE) == TRUE > - OvmfPkg/SmmAccess/SmmAccessPei.inf { > - <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > - } > + OvmfPkg/SmmAccess/SmmAccessPei.inf > !endif > - UefiCpuPkg/CpuMpPei/CpuMpPei.inf { > - <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > - } > + UefiCpuPkg/CpuMpPei/CpuMpPei.inf > > # > # DXE Phase modules Now, if I change the PcdLib resolution for [LibraryClasses.common.PEIM] only -- I haven't checked this before --, we get > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc > index 022661628dbe..3fdc8231f514 100644 > --- a/OvmfPkg/OvmfPkgX64.dsc > +++ b/OvmfPkg/OvmfPkgX64.dsc > @@ -199,6 +199,7 @@ [LibraryClasses.common.PEI_CORE] > PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > > [LibraryClasses.common.PEIM] > + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf > PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf > PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf > @@ -506,33 +507,22 @@ [Components] > <LibraryClasses> > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > } > - IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf > - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { > + IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf { > <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > - } > - > - OvmfPkg/PlatformPei/PlatformPei.inf { > - <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > } > + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > + OvmfPkg/PlatformPei/PlatformPei.inf > UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { > <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > !if $(SMM_REQUIRE) == TRUE > LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf > !endif > } > !if $(SMM_REQUIRE) == TRUE > - OvmfPkg/SmmAccess/SmmAccessPei.inf { > - <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > - } > + OvmfPkg/SmmAccess/SmmAccessPei.inf > !endif > - UefiCpuPkg/CpuMpPei/CpuMpPei.inf { > - <LibraryClasses> > - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > - } > + UefiCpuPkg/CpuMpPei/CpuMpPei.inf > > # > # DXE Phase modules In this case, we trade the current 5 overrides (to PeiPcdLib) for a change of default plus one new override (BasePcdLibNull for StatusCodePei). Should I submit this second change? Thanks Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
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 + } # # 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 ################################################################################
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.fan@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@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(+) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel