mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/CoreDxe: Allow DXE Drivers to use untested memory
REF: https://https://bugzilla.tianocore.org/show_bug.cgi?id=3795 Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Updated CoreInternalAllocatePages() to call PromoteMemoryResource() and re-attempt the allocation if unable to convert the specified memory range Signed-off-by: Stacy Howell <stacy.howell@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
parent
7ef91af84c
commit
494f333aba
|
@ -1417,6 +1417,20 @@ CoreInternalAllocatePages (
|
|||
Status = CoreConvertPages (Start, NumberOfPages, MemoryType);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// If requested memory region is unavailable it may be untested memory
|
||||
// Attempt to promote memory resources, then re-attempt the allocation
|
||||
//
|
||||
if (PromoteMemoryResource ()) {
|
||||
if (NeedGuard) {
|
||||
Status = CoreConvertPagesWithGuard (Start, NumberOfPages, MemoryType);
|
||||
} else {
|
||||
Status = CoreConvertPages (Start, NumberOfPages, MemoryType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Done:
|
||||
CoreReleaseMemoryLock ();
|
||||
|
||||
|
|
Loading…
Reference in New Issue