audk/ArmPkg/Library/ArmMmuLib
Ard Biesheuvel 28ce4cb359 ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling
PopulateLevel2PageTable () is invoked for [parts of] mappings that
start or end on a non-1 MB aligned address (or both). The size of
the mapping depends on both the start address modulo 1 MB and the
length of the mapping, but the logic that calculates this size is
flawed: subtracting 'start address modulo 1 MB' could result in a
negative value for the remaining length, which is obviously wrong.

So instead, take either RemainLength, or the rest of the 1 MB
block, whichever is smaller.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Eugene Cohen <eugene@hp.com>
2019-01-13 17:33:28 +01:00
..
AArch64 ArmPkg/ArmMmuLib: take MAX_ALLOC_ADDRESS into account 2018-12-20 11:02:07 +01:00
Arm ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling 2019-01-13 17:33:28 +01:00
ArmMmuBaseLib.inf ArmPkg/ArmMmuLib: take the CPU supported maximum PA space into account 2018-11-29 18:54:59 +01:00
ArmMmuPeiLib.inf ArmPkg/ArmMmuLib: take the CPU supported maximum PA space into account 2018-11-29 18:54:59 +01:00