]> git.proxmox.com Git - mirror_edk2.git/commit
ArmPkg/ArmMmuLib: use a pool allocation for the root table
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 9 Sep 2016 08:50:21 +0000 (09:50 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 13 Sep 2016 12:43:11 +0000 (13:43 +0100)
commitd32702d2c2aa23e828363a7f88829b78ce36c3af
tree4271ebae9e1e0a204acb5985640cede95670c8ed
parent674e127ef64b07a1e6e6bcc5ecbaead50ea81134
ArmPkg/ArmMmuLib: use a pool allocation for the root table

Currently, we allocate a full page for the root translation table, even
if the configured translation only requires two entries (16 bytes) for
the root level, which happens to be the case for a 40 bit VA. Likewise,
for a 36-bit VA space, the root table only needs 16 entries of 8 bytes
each, adding up to 128 bytes.

So switch to a pool allocation for the root table if we can, but take into
account that the architecture requires it to be naturally aligned to its
size, i.e., a 64 byte table requires 64 byte alignment, whereas pool
allocations in general are only guaranteed to be aligned to 8 bytes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c