ArmPkg/ArmMmuLib ARM: implement memory permission control routines
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 1 Mar 2017 16:31:42 +0000 (16:31 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 7 Mar 2017 09:31:53 +0000 (10:31 +0100)
commit9f1dcbe8c8b337770e121fea1ef3cb26f43851c9
tree4c0d98c1e0ff10cbbfb1878bc1ca5df887e88a01
parentd9c0d991f769c50e69d14a006bdbaaf31986143a
ArmPkg/ArmMmuLib ARM: implement memory permission control routines

Now that we have the prerequisite functionality available in ArmMmuLib,
wire it up into ArmSetMemoryRegionNoExec, ArmClearMemoryRegionNoExec,
ArmSetMemoryRegionReadOnly and ArmClearMemoryRegionReadOnly. This is
used by the non-executable stack feature that is configured by DxeIpl.

NOTE: The current implementation will not combine RO and XP attributes,
      i.e., setting/clearing a region no-exec will unconditionally
      clear the read-only attribute, and vice versa. Currently, we
      only use ArmSetMemoryRegionNoExec(), so for now, we should be
      able to live with this.

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/Arm/ArmMmuLibCore.c