]> git.proxmox.com Git - mirror_edk2.git/commit
ArmPkg/UncachedMemoryAllocationLib: set XP bit via CPU arch protocol
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 14 Mar 2017 19:52:11 +0000 (19:52 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 15 Mar 2017 19:36:10 +0000 (19:36 +0000)
commit0985beff2ce5e9f41e39e1900a8d19d22975d733
treec5ae8204c0f70043edc5f906684b8a1a9b860b07
parent7e1bc8cdb387430de34cf46a3da14b09dd2e84e2
ArmPkg/UncachedMemoryAllocationLib: set XP bit via CPU arch protocol

Commit e7b24ec9785d ("ArmPkg/UncachedMemoryAllocationLib: map uncached
allocations non-executable") adds code that manipulates the GCD memory
space attributes of a newly allocated uncached region without checking
whether this region expose these attributes in its capabilities mask.

Given that the intent is to remove executable permissions from the region,
this is a fairly pointless exercise to begin with, regardless of whether
it is correct or not. The reason is that RO/XP memory attributes in the
GCD memory space map or the UEFI memory map are completely disconnected
from the actual mapping permissions used in the page tables.

So instead, invoke the CPU arch protocol directly, and add the non-exec
attributes in the page tables directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf