MdeModulePkg/PiSmmCore: Replace BASE_4GB with MAX_ADDRESS check.

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 <jeff.fan@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Jiewen Yao 2016-06-29 10:19:57 +08:00
parent 599c45ff0b
commit 10e4e4f627
2 changed files with 2 additions and 2 deletions

View File

@ -1556,7 +1556,7 @@ SmmIplEntry (
} }
if (gSmmCorePrivate->SmramRanges[Index].CpuStart >= BASE_1MB) { 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) { if (gSmmCorePrivate->SmramRanges[Index].PhysicalSize >= MaxSize) {
MaxSize = gSmmCorePrivate->SmramRanges[Index].PhysicalSize; MaxSize = gSmmCorePrivate->SmramRanges[Index].PhysicalSize;
mCurrentSmramRange = &gSmmCorePrivate->SmramRanges[Index]; mCurrentSmramRange = &gSmmCorePrivate->SmramRanges[Index];

View File

@ -67,7 +67,7 @@ SmmInitializeMemoryServices (
} }
if (SmramRanges[Index].CpuStart >= BASE_1MB) { 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) { if (SmramRanges[Index].PhysicalSize >= MaxSize) {
MaxSize = SmramRanges[Index].PhysicalSize; MaxSize = SmramRanges[Index].PhysicalSize;
CurrentSmramRangesIndex = Index; CurrentSmramRangesIndex = Index;