summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-12-07 11:57:22 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-12-20 11:02:07 +0100
commit1c36f028fae7583eb4ff5201ea109d90eaedf11e (patch)
treefc5b46c56d64e2419dce8ea0d0f0f329212965aa /ArmPkg
parent76be882cdc0722c9b4a2b2b0a4e52e1727333e09 (diff)
downloadedk2-1c36f028fae7583eb4ff5201ea109d90eaedf11e.tar.gz
edk2-1c36f028fae7583eb4ff5201ea109d90eaedf11e.tar.bz2
edk2-1c36f028fae7583eb4ff5201ea109d90eaedf11e.zip
ArmPkg/ArmMmuLib: take MAX_ALLOC_ADDRESS into account
When creating the page tables for the 1:1 mapping, ensure that we don't attempt to map more than what is architecturally permitted when running with 4 KB pages, which is 48 bits of VA. This will be reflected in the value of MAX_ALLOC_ADDRESS once we override it for AArch64, so use that macro instead of MAX_ADDRESS. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
index 5403b8d407..e41044142e 100644
--- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
+++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
@@ -612,7 +612,7 @@ ArmConfigureMmu (
// use of 4 KB pages.
//
MaxAddress = MIN (LShiftU64 (1ULL, ArmGetPhysicalAddressBits ()) - 1,
- MAX_ADDRESS);
+ MAX_ALLOC_ADDRESS);
// Lookup the Table Level to get the information
LookupAddresstoRootTable (MaxAddress, &T0SZ, &RootTableEntryCount);