audk/ArmPkg/Library/ArmMmuLib
Ard Biesheuvel f7079d1bc1 ArmPkg/ArmMmuLib AARCH64: preserve attributes when replacing a table entry
Currently, depending on the size of the region being (re)mapped, the
page table manipulation code may replace a table entry with a block entry,
even if the existing table entry uses different mapping attributes to
describe different parts of the region it covers. This is undesirable, and
instead, we should avoid doing so unless we are disregarding the original
attributes anyway. And if we make such a replacement, we should free all
the page tables that have become orphaned in the process.

So let's implement this, by taking the table entry path through the code
for block sized regions if a table entry already exists, and the clear
mask is set (which means we are preserving attributes from the existing
mapping). And when we do replace a table entry with a block entry, free
all the pages that are no longer referenced.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Ashish Singhal <ashishsingha@nvidia.com>
Tested-by: Ashish Singhal <ashishsingha@nvidia.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
2020-03-26 10:34:14 +00:00
..
AArch64 ArmPkg/ArmMmuLib AARCH64: preserve attributes when replacing a table entry 2020-03-26 10:34:14 +00:00
Arm ArmPkg/ArmMmuLib ARM: drop memory type check for page tables 2020-03-05 21:08:30 +00:00
ArmMmuBaseLib.inf ArmPkg/ArmMmuLib ARM: split ArmMmuLibCore.c into core and update code 2020-03-05 21:08:30 +00:00
ArmMmuPeiLib.inf ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00