audk/ArmPkg
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
..
Drivers ArmPkg/MmCommunicationDxe: fix logic bug in DXE driver entrypoint 2020-03-04 17:42:43 +00:00
Filesystem/SemihostFs ArmPkg: Fix various typos 2019-07-04 12:20:28 +01:00
Include ArmPkg/ArmLib: move set/way helper functions into private header 2020-03-05 21:08:30 +00:00
Library ArmPkg/ArmMmuLib AARCH64: preserve attributes when replacing a table entry 2020-03-26 10:34:14 +00:00
ArmPkg.dec ArmPkg/ArmSmcPsciResetSystemLib: remove EnterS3WithImmediateWake () 2020-01-14 22:12:17 +00:00
ArmPkg.dsc ArmPkg/ArmPkg.dsc: Add missing components 2020-03-25 09:56:23 +00:00