From cfc80e2e95ee639e240c09eaeab76c0286bf917e Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 26 Jun 2015 16:09:48 +0000 Subject: OvmfPkg: PlatformPei: beautify memory HOB order in QemuInitializeRam() Build the memory HOBs in a tight block, in increasing base address order. Cc: Maoming Cc: Huangpeng (Peter) Cc: Wei Liu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Tested-by: Maoming Reviewed-by: Jordan Justen git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17721 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/PlatformPei/MemDetect.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OvmfPkg') diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c index ceff1e2563..b74308f562 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -265,8 +265,11 @@ QemuInitializeRam ( // // Create memory HOBs // - AddMemoryRangeHob (BASE_1MB, LowerMemorySize); AddMemoryRangeHob (0, BASE_512KB + BASE_128KB); + AddMemoryRangeHob (BASE_1MB, LowerMemorySize); + if (UpperMemorySize != 0) { + AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize); + } } MtrrSetMemoryAttribute (BASE_1MB, LowerMemorySize - BASE_1MB, CacheWriteBack); @@ -274,10 +277,6 @@ QemuInitializeRam ( MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack); if (UpperMemorySize != 0) { - if (mBootMode != BOOT_ON_S3_RESUME) { - AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize); - } - MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack); } } -- cgit v1.2.3