mirror_edk2/MdeModulePkg/Library
Sunny Wang fb5848c588 MdeModulePkg/UefiBootManagerLib: Fix data in MemoryTypeInformation
After booting a large-size ISO RAM disk (HTTP boot option pointing to
a ISO file) and reboot system, system will possibly run into the
following ASSERT because the BDS core code doesn't consider the
case that Memory page management (Page.c) would possibly NOT update
current memory usage statistics(CurrentMemoryTypeInformation) if
system allocates a memory buffer with a large number of pages.
ASSERT [DxeCore] u:\MdeModulePkg\Core\Dxe\Gcd\Gcd.c(2273):
Length >= MinimalMemorySizeNeeded

The BDS code block for skipping counting reserved memory occupied
by RAM Disk didn't consider the Memory page management's behavior
mentioned above, which caused that the
CurrentMemoryTypeInformation[Index1].NumberOfPages will be updated
to a "very big value" because RamDiskSizeInPages is bigger than
CurrentMemoryTypeInformation[Index1].NumberOfPages. For example,
NumberOfPages is 0x9000 (current use) and RamDiskSizeInPages is
0xC0000 (ISO image size). The result will become a very big value
0xFFF49000.

Therefore, we need to add a check to prevent BDS core code updating
wrong data (very big value) to MemoryTypeInformation variable. This
code change is a improvement for fixing this issue for most cases.
There is still a corner case even when the memory bins don't include
the RAM disk memory, the memory used by all other modules exceeds
RamDiskSizeInPages. Ray will send the other patch to fix this corner
case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-06-27 10:38:09 +08:00
..
AuthVariableLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
BaseIpmiLibNull MdeModulePkg: Add the missing Library uni files of Ipmi instances 2015-12-24 02:28:45 +00:00
BasePlatformHookLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
BaseResetSystemLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
BaseSerialPortLib16550 MdeModulePkg BaseSerialPortLib: Fix VS2010 build error 2016-01-11 00:34:15 +00:00
BaseSortLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
BmpImageDecoderLib MdeModulePkg: Add the missing Library uni files of ImageDecode instances 2015-12-24 02:29:23 +00:00
BootLogoLib MdeModulePkg: Add the missing Library uni files of ImageDecode instances 2015-12-24 02:29:23 +00:00
BootMaintenanceManagerUiLib MdeModulePkg: Make function comments and function match in UI codes 2016-05-25 16:35:36 +08:00
BootManagerUiLib MdeModulePkg/BootManagerUiLib: No need to connect all devices 2016-06-21 12:33:48 +08:00
CpuExceptionHandlerLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
CustomizedDisplayLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DebugAgentLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DeviceManagerUiLib MdeModulePkg: DeviceManagerUiLib: remove set but unused variables 2016-03-25 10:52:29 +01:00
DxeCapsuleLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeCoreMemoryAllocationLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeCorePerformanceLib MdeModulePkg: Update PerformanceLib instances not to check Identifier. 2016-04-11 16:20:28 +08:00
DxeCrc32GuidedSectionExtractLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeDebugPrintErrorLevelLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeDpcLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeFileExplorerProtocol MdeModulePkg DxeFileExplorerProtocol: Change file format which has mixed file format. 2015-12-16 03:20:21 +00:00
DxeHttpLib MdeModulePkg: Refine the code for DxeHttpLib 2016-05-17 20:23:18 +08:00
DxeIpIoLib MdeModulePkg: Check received packet size before use it. 2016-04-01 13:30:08 +08:00
DxeIpmiLibIpmiProtocol MdeModulePkg: Add the missing Library uni files of Ipmi instances 2015-12-24 02:28:45 +00:00
DxeNetLib MdeModulePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr 2016-06-21 12:46:24 +08:00
DxePerformanceLib MdeModulePkg: Update PerformanceLib instances not to check Identifier. 2016-04-11 16:20:28 +08:00
DxePrintLibPrint2Protocol MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeReportStatusCodeLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeSecurityManagementLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeSmmPerformanceLib MdeModulePkg-FPDT(4): Use fixed buffer for SMM_PERF_COMMUNICATE in PerfLib. 2016-04-29 12:49:21 +08:00
DxeTcpIoLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
DxeUdpIoLib MdeModulePkg: DxeUdpIoLib: fix non-empty payload path in UDP reception 2016-04-04 13:53:12 +02:00
FileExplorerLib MdeModulePkg: FileExplorerLib: prevent freeing null pointer 2016-05-09 16:18:00 +08:00
ImageDecoderLib MdeModulePkg: Add the missing Library uni files of ImageDecode instances 2015-12-24 02:29:23 +00:00
LockBoxNullLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
LzmaCustomDecompressLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
OemHookStatusCodeLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PciHostBridgeLibNull MdeModulePkg/PciHostBridgeLib: Correct the function header comments 2016-03-03 18:24:25 +01:00
PeiCrc32GuidedSectionExtractLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiDebugPrintHobLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiDxeDebugLibReportStatusCode MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiIpmiLibIpmiPpi MdeModulePkg: Add the missing Library uni files of Ipmi instances 2015-12-24 02:28:45 +00:00
PeiPerformanceLib MdeModulePkg: Update PerformanceLib instances not to check Identifier. 2016-04-11 16:20:28 +08:00
PeiRecoveryLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiReportStatusCodeLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PeiS3LibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PiDxeS3BootScriptLib MdeModulePkg DxeS3BootScriptLib: Check (mSmst != NULL) before freeing SMRAM 2016-06-13 16:04:22 +08:00
PiSmmCoreMemoryAllocationLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PiSmmCoreSmmServicesTableLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PlatformBootManagerLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PlatformHookLibSerialPortPpi MdeModulePkg: Correct PlatformHookLibSerialPortPpi module type. 2016-04-25 13:17:05 +08:00
PlatformVarCleanupLib MdeModulePkg PlatformVarCleanupLib: Locate VarCheck protocol when using 2016-03-18 15:14:34 +08:00
RuntimeDxeReportStatusCodeLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
SmmCorePerformanceLib MdeModulePkg: Update PerformanceLib instances not to check Identifier. 2016-04-11 16:20:28 +08:00
SmmCorePlatformHookLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
SmmIpmiLibSmmIpmiProtocol MdeModulePkg: Add the missing Library uni files of Ipmi instances 2015-12-24 02:28:45 +00:00
SmmLockBoxLib MdeModulePkg SmmLockBoxSmmLib: Add DESTRUCTOR SmmLockBoxSmmDestructor 2016-06-07 10:01:09 +08:00
SmmPerformanceLib MdeModulePkg: Update PerformanceLib instances not to check Identifier. 2016-04-11 16:20:28 +08:00
SmmReportStatusCodeLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
TpmMeasurementLibNull MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UefiBootManagerLib MdeModulePkg/UefiBootManagerLib: Fix data in MemoryTypeInformation 2016-06-27 10:38:09 +08:00
UefiHiiLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UefiHiiServicesLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UefiSortLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
VarCheckHiiLib MdeModulePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr 2016-06-21 12:46:24 +08:00
VarCheckLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
VarCheckPcdLib MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
VarCheckUefiLib MdeModulePkg: VarCheckUefiLib: Remove DeployedMode/AuditMode var check logic 2016-05-04 09:13:47 +08:00