audk/MdeModulePkg/Core
Heyi Guo 1365bedd48 MdeModulePkg: Fix bug of AllocatePages for large alignment
DescEnd will be clipped for alignment in CoreFindFreePagesI, and it
may fall below DescStart, when alignment is more than 16KB (included)
and both DescStart and original DescEnd fall into a single range of
such alignment. This results in a huge size (Negative number in
unsigned type) for this descriptor, fulfilling the allocation
requirement but failing to run ConvertPages; at last it causes
occasional failure of AllocatePages.

A simple comparison is added to ensure we would never get a negative
number.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17575 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-08 09:24:31 +00:00
..
Dxe MdeModulePkg: Fix bug of AllocatePages for large alignment 2015-06-08 09:24:31 +00:00
DxeIplPeim MdeModulePkg: Convert non DOS format files to DOS format and remove unused module UNI files. 2014-09-03 08:39:12 +00:00
Pei MdeModulePkg: Update implementation of PeiAllocatePages() to allow EfiReservedMemoryType. 2015-05-11 03:12:21 +00:00
PiSmmCore PiSmmCore dispatcher should not use one Index for three loops. 2015-06-06 23:49:39 +00:00
RuntimeDxe MdeModulePkg: Roll back report status code change in RuntimeDriverSetVirtualAddressMap. 2015-04-10 01:37:41 +00:00