mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
OvmfPkg/PlatformInitLib: detect physical address space
Try detect physical address space, when successful use it. Otherwise go continue using the current guesswork code path. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
8f9ef9c9a0
commit
bbda386d25
1 changed files with 13 additions and 0 deletions
|
|
@ -761,6 +761,19 @@ PlatformAddressWidthInitialization (
|
|||
FirstNonAddress = PlatformGetFirstNonAddress (PlatformInfoHob);
|
||||
}
|
||||
|
||||
PlatformAddressWidthFromCpuid (PlatformInfoHob, TRUE);
|
||||
if (PlatformInfoHob->PhysMemAddressWidth != 0) {
|
||||
// physical address width is known
|
||||
PlatformInfoHob->FirstNonAddress = FirstNonAddress;
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// physical address width is NOT known
|
||||
// -> do some guess work, mostly based on installed memory
|
||||
// -> try be conservstibe to stay below the guaranteed minimum of
|
||||
// 36 phys bits (aka 64 GB).
|
||||
//
|
||||
PhysMemAddressWidth = (UINT8)HighBitSet64 (FirstNonAddress);
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue