On 06/29/16 23:45, Jiewen Yao wrote: > PI specification Vol 4 - SMM does not have any limitation of BASE_4GB for SMM. > So we should replace BASE_4GB check with MAX_ADDRESS check to make sure > the SMM memory is accessible by SMM Core. > > Cc: Jeff Fan <[email protected]> > Cc: Michael D Kinney <[email protected]> > Cc: Laszlo Ersek <[email protected]> > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiewen Yao <[email protected]> > --- > MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 2 +- > MdeModulePkg/Core/PiSmmCore/Pool.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c > b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c > index acfcc83..3788bd5 100644 > --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c > +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c > @@ -1556,7 +1556,7 @@ SmmIplEntry ( > } > > if (gSmmCorePrivate->SmramRanges[Index].CpuStart >= BASE_1MB) { > - if ((gSmmCorePrivate->SmramRanges[Index].CpuStart + > gSmmCorePrivate->SmramRanges[Index].PhysicalSize) <= BASE_4GB) { > + if ((gSmmCorePrivate->SmramRanges[Index].CpuStart + > gSmmCorePrivate->SmramRanges[Index].PhysicalSize - 1) <= MAX_ADDRESS) { > if (gSmmCorePrivate->SmramRanges[Index].PhysicalSize >= MaxSize) { > MaxSize = gSmmCorePrivate->SmramRanges[Index].PhysicalSize; > mCurrentSmramRange = &gSmmCorePrivate->SmramRanges[Index]; > diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c > b/MdeModulePkg/Core/PiSmmCore/Pool.c > index 761988e..e493fd2 100644 > --- a/MdeModulePkg/Core/PiSmmCore/Pool.c > +++ b/MdeModulePkg/Core/PiSmmCore/Pool.c > @@ -67,7 +67,7 @@ SmmInitializeMemoryServices ( > } > > if (SmramRanges[Index].CpuStart >= BASE_1MB) { > - if ((SmramRanges[Index].CpuStart + SmramRanges[Index].PhysicalSize) > <= BASE_4GB) { > + if ((SmramRanges[Index].CpuStart + SmramRanges[Index].PhysicalSize - > 1) <= MAX_ADDRESS) { > if (SmramRanges[Index].PhysicalSize >= MaxSize) { > MaxSize = SmramRanges[Index].PhysicalSize; > CurrentSmramRangesIndex = Index; >
Reviewed-by: Laszlo Ersek <[email protected]> _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

