audk/ArmPkg/Include
Ard Biesheuvel 8f5ad634ad ArmPkg/ArmMmuLib: Extend API to manage memory permissions better
Currently, ArmSetMemoryAttributes () takes a combination of
EFI_MEMORY_xx constants describing the memory type and permission
attributes that should be set on a region of memory. In cases where the
memory type is omitted, we assume that the memory permissions being set
are final, and that existing memory permissions can be discarded.

This is problematic, because we aim to map memory non-executable
(EFI_MEMORY_XP) by default, and only relax this requirement for code
regions that are mapped read-only (EFI_MEMORY_RO). Currently, setting
one permission clears the other, and so code managing these permissions
has to be aware of the existing permissions in order to be able to
preserve them, and this is not always tractable (e.g., the UEFI memory
attribute protocol implements an abstraction that promises to preserve
memory permissions that it is not operating on explicitly).

So let's add an AttributeMask parameter to ArmSetMemoryAttributes(),
which is permitted to be non-zero if no memory type is being provided,
in which case only memory permission attributes covered in the mask will
be affected by the update.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
2023-06-26 09:11:53 +00:00
..
Chipset ArmPkg: older assemblers may lack ID_AA64ISAR2_EL1 2023-04-20 20:11:46 +00:00
Guid ArmPkg/CpuDxe: drop ARM_PROCESSOR_TABLE pseudo-ACPI table 2022-07-22 17:10:09 +00:00
IndustryStandard ArmPkg: add SMC defines for SiP service calls 2023-06-02 11:21:26 +00:00
Library ArmPkg/ArmMmuLib: Extend API to manage memory permissions better 2023-06-26 09:11:53 +00:00
Ppi ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Protocol ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
AsmMacroIoLib.h ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
AsmMacroIoLib.inc ArmPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:21 -07:00
AsmMacroIoLibV8.h ArmPkg/AsmMacroIoLibV8: Introduce ASM_FUNC_ALIGN() 2023-04-20 16:20:35 +00:00