ArmVirtPkg/HighMemDxe: use CPU arch protocol to apply memprotect policy
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 21 Mar 2017 08:47:23 +0000 (08:47 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 21 Mar 2017 10:41:12 +0000 (10:41 +0000)
commit60bd1e1269ff93390a90014144a835ad71fe2fa0
tree9b3a2df0416d5a8df29def78192158a92b988768
parent09da11081915dea25d2d1bba87cdf460102e52bb
ArmVirtPkg/HighMemDxe: use CPU arch protocol to apply memprotect policy

Instead of invoking gDS->SetMemorySpaceAttributes to set the EFI_MEMORY_XP
attribute on newly added regions, which is guaranteed to fail if the same
attribute was not declared as a capability of the region when it as added,
invoke the CPU arch protocol directly to set the EFI_MEMORY_XP attribute
if our memory protection policy demands it.

Reported-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/HighMemDxe/HighMemDxe.c
ArmVirtPkg/HighMemDxe/HighMemDxe.inf