On 11/24/15 09:36, jiewen yao wrote: > In this way, we can centralize the silicon configuration in > PerformRemainingTasks()/PerformPreTasks() function. > If there are more features need to be configured, they can put in > PerformRemainingTasks()/PerformPreTasks() only. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: "Yao, Jiewen" <jiewen....@intel.com> > Cc: "Fan, Jeff" <jeff....@intel.com> > Cc: "Kinney, Michael D" <michael.d.kin...@intel.com> > Cc: "Laszlo Ersek" <ler...@redhat.com> > --- > UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 10 ++-------- > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 22 ++++++++++++++++++++++ > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 9 +++++++++ > 3 files changed, 33 insertions(+), 8 deletions(-) > > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > index 730c32d..d20aa27 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > @@ -412,15 +412,9 @@ BSPHandler ( > AcquireSpinLockOrFail (&mSmmMpSyncData->CpuData[CpuIndex].Busy); > > // > - // Restore SMM Configuration in S3 boot path. > + // Perform the pre tasks > // > - if (mRestoreSmmConfigurationInS3) { > - // > - // Configure SMM Code Access Check feature if available. > - // > - ConfigSmmCodeAccessCheck (); > - mRestoreSmmConfigurationInS3 = FALSE; > - } > + PerformPreTasks (); > > // > // Invoke SMM Foundation EntryPoint with the processor information context. > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > index 532ac09..2489848 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > @@ -1437,3 +1437,25 @@ PerformRemainingTasks ( > mSmmReadyToLock = FALSE; > } > } > + > +/** > + Perform the pre tasks. > + > +**/ > +VOID > +PerformPreTasks ( > + VOID > + ) > +{ > + // > + // Restore SMM Configuration in S3 boot path. > + // > + if (mRestoreSmmConfigurationInS3) { > + // > + // Configure SMM Code Access Check feature if available. > + // > + ConfigSmmCodeAccessCheck (); > + > + mRestoreSmmConfigurationInS3 = FALSE; > + } > +} > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h > b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h > index cfbf2ca..96d55c0 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h > @@ -572,6 +572,15 @@ PerformRemainingTasks ( > ); > > /** > + Perform the pre tasks. > + > +**/ > +VOID > +PerformPreTasks ( > + VOID > + ); > + > +/** > Initialize MSR spin lock by MSR index. > > @param MsrIndex MSR index value. >
This one is much easier to understand, thanks! I think the two leading space characters in the commit message should be removed. With those fixed up, Reviewed-by: Laszlo Ersek <ler...@redhat.com> Thanks! Laszlo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel