Exploit that (MemoryBase + MemorySize) always equals LowerMemorySize.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
---
 OvmfPkg/PlatformPei/MemDetect.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c
index 9145ebb..7192b2b 100644
--- a/OvmfPkg/PlatformPei/MemDetect.c
+++ b/OvmfPkg/PlatformPei/MemDetect.c
@@ -161,11 +161,10 @@ MemDetect (
   //
   // Create memory HOBs
   //
-  AddMemoryBaseSizeHob (MemoryBase, MemorySize);
-  AddMemoryRangeHob (BASE_1MB, MemoryBase);
+  AddMemoryRangeHob (BASE_1MB, LowerMemorySize);
   AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
 
-  MtrrSetMemoryAttribute (BASE_1MB, MemoryBase + MemorySize - BASE_1MB, 
CacheWriteBack);
+  MtrrSetMemoryAttribute (BASE_1MB, LowerMemorySize - BASE_1MB, 
CacheWriteBack);
 
   MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack);
 
@@ -175,6 +174,6 @@ MemDetect (
     MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack);
   }
 
-  return MemoryBase + MemorySize;
+  return LowerMemorySize;
 }
 
-- 
1.8.3.1



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to