]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PiSmmCore: Replace BASE_4GB with MAX_ADDRESS check.
authorJiewen Yao <jiewen.yao@intel.com>
Wed, 29 Jun 2016 02:19:57 +0000 (10:19 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Fri, 1 Jul 2016 01:03:59 +0000 (09:03 +0800)
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>
MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
MdeModulePkg/Core/PiSmmCore/Pool.c

index acfcc83e4f56b1e8499337d154a2aa7896d49f02..acb852b8dd4b6702235b6b58968fd2f53f691d71 100644 (file)
@@ -1556,7 +1556,7 @@ SmmIplEntry (
     }\r
 \r
     if (gSmmCorePrivate->SmramRanges[Index].CpuStart >= BASE_1MB) {\r
-      if ((gSmmCorePrivate->SmramRanges[Index].CpuStart + gSmmCorePrivate->SmramRanges[Index].PhysicalSize) <= BASE_4GB) {\r
+      if ((gSmmCorePrivate->SmramRanges[Index].CpuStart + gSmmCorePrivate->SmramRanges[Index].PhysicalSize - 1) <= MAX_ADDRESS) {\r
         if (gSmmCorePrivate->SmramRanges[Index].PhysicalSize >= MaxSize) {\r
           MaxSize = gSmmCorePrivate->SmramRanges[Index].PhysicalSize;\r
           mCurrentSmramRange = &gSmmCorePrivate->SmramRanges[Index];\r
index 761988e4162b840c9a0622a4df456bcf871f8508..79847b4bb6d027b489361a7eff84ed2ad1c1defe 100644 (file)
@@ -67,7 +67,7 @@ SmmInitializeMemoryServices (
       }\r
 \r
       if (SmramRanges[Index].CpuStart >= BASE_1MB) {\r
-        if ((SmramRanges[Index].CpuStart + SmramRanges[Index].PhysicalSize) <= BASE_4GB) {\r
+        if ((SmramRanges[Index].CpuStart + SmramRanges[Index].PhysicalSize - 1) <= MAX_ADDRESS) {\r
           if (SmramRanges[Index].PhysicalSize >= MaxSize) {\r
             MaxSize = SmramRanges[Index].PhysicalSize;\r
             CurrentSmramRangesIndex = Index;\r