From 035ce3b37c90073e5be16e9628127774bd10348c Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Thu, 21 Apr 2016 14:31:55 +0800 Subject: [PATCH] OvmfPkg/PlatformPei: Add memory above 4GB as tested Since PlatformBootManagerLib do not run memory test to convert untested memory to tested. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Tested-by: Laszlo Ersek Reviewed-by: Laszlo Ersek --- OvmfPkg/PlatformPei/MemDetect.c | 4 ++-- OvmfPkg/PlatformPei/Platform.c | 29 ----------------------------- OvmfPkg/PlatformPei/Platform.h | 14 +------------- OvmfPkg/PlatformPei/Xen.c | 8 ++------ 4 files changed, 5 insertions(+), 50 deletions(-) diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c index ed13c57beb..7991ba29d7 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -1,7 +1,7 @@ /**@file Memory Detection for Virtual Machines. - Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -422,7 +422,7 @@ QemuInitializeRam ( } if (UpperMemorySize != 0) { - AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize); + AddMemoryBaseSizeHob (BASE_4GB, UpperMemorySize); } } diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index ef654c4579..4be9922aeb 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -151,35 +151,6 @@ AddMemoryRangeHob ( } -VOID -AddUntestedMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize - ) -{ - BuildResourceDescriptorHob ( - EFI_RESOURCE_SYSTEM_MEMORY, - EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE, - MemoryBase, - MemorySize - ); -} - - -VOID -AddUntestedMemoryRangeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - EFI_PHYSICAL_ADDRESS MemoryLimit - ) -{ - AddUntestedMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase)); -} - VOID MemMapInitialization ( VOID diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h index dad3c61e26..bb988ea19e 100644 --- a/OvmfPkg/PlatformPei/Platform.h +++ b/OvmfPkg/PlatformPei/Platform.h @@ -1,7 +1,7 @@ /** @file Platform PEI module include file. - Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -41,12 +41,6 @@ AddMemoryRangeHob ( EFI_PHYSICAL_ADDRESS MemoryLimit ); -VOID -AddUntestedMemoryBaseSizeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - UINT64 MemorySize - ); - VOID AddReservedMemoryBaseSizeHob ( EFI_PHYSICAL_ADDRESS MemoryBase, @@ -54,12 +48,6 @@ AddReservedMemoryBaseSizeHob ( BOOLEAN Cacheable ); -VOID -AddUntestedMemoryRangeHob ( - EFI_PHYSICAL_ADDRESS MemoryBase, - EFI_PHYSICAL_ADDRESS MemoryLimit - ); - VOID AddressWidthInitialization ( VOID diff --git a/OvmfPkg/PlatformPei/Xen.c b/OvmfPkg/PlatformPei/Xen.c index 7fa9019f1a..3a4358251e 100644 --- a/OvmfPkg/PlatformPei/Xen.c +++ b/OvmfPkg/PlatformPei/Xen.c @@ -1,7 +1,7 @@ /**@file Xen Platform PEI support - Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
Copyright (c) 2011, Andrei Warkentin This program and the accompanying materials @@ -189,11 +189,7 @@ XenPublishRamRegions ( continue; } - if (Entry->BaseAddr >= BASE_4GB) { - AddUntestedMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length); - } else { - AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length); - } + AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length); MtrrSetMemoryAttribute (Entry->BaseAddr, Entry->Length, CacheWriteBack); } -- 2.39.2