audk/ArmPkg/Library/ArmMmuLib/Arm
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
..
ArmMmuLibCore.c ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling 2019-01-13 17:33:28 +01:00
ArmMmuLibV7Support.S ArmPkg: introduce base ArmMmuLib implementation 2016-07-07 14:33:47 +02:00
ArmMmuLibV7Support.asm ArmPkg: introduce base ArmMmuLib implementation 2016-07-07 14:33:47 +02:00