audk/ArmPkg/Library
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
..
ArmArchTimerLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmCacheMaintenanceLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmDisassemblerLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmExceptionLib ArmPkg: Emit BTI opcodes when BTI codegen is enabled 2023-03-30 11:05:22 +00:00
ArmGenericTimerPhyCounterLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmGenericTimerVirtCounterLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmGicArchLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmGicArchSecLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmHvcLib ArmPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
ArmHvcLibNull ArmPkg/ArmHvcLibNull: Add NULL instance of ArmHvcLib 2022-11-06 16:32:28 +00:00
ArmLib ArmLib: add functions to read system registers 2023-04-21 18:50:05 +00:00
ArmMmuLib ArmPkg/ArmMmuLib: Extend API to manage memory permissions better 2023-06-26 09:11:53 +00:00
ArmMonitorLib ArmPkg/ArmMonitorLib: Add ArmMonitorLib 2022-11-06 16:32:28 +00:00
ArmMtlNullLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmPsciResetSystemLib ArmPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
ArmSmcLib ArmPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
ArmSmcLibNull ArmPkg: Add SMC helper functions 2021-12-14 11:30:26 +00:00
ArmSmcPsciResetSystemLib ArmPkg: Handle warm reboot request correctly 2022-09-05 13:52:51 +00:00
ArmSoftFloatLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ArmSvcLib ArmPkg: Emit BTI opcodes when BTI codegen is enabled 2023-03-30 11:05:22 +00:00
ArmTrngLib ArmPkg/ArmTrngLib: Remove ASSERTs in ArmTrngLibConstructor() 2022-11-26 14:42:41 +00:00
CompilerIntrinsicsLib ArmPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
DebugAgentSymbolsBaseLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DebugPeCoffExtraActionLib ArmPkg: Remove RealView Debugger support 2023-01-30 16:50:14 +00:00
DefaultExceptionHandlerLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GccLto ArmPkg/GccLto AARCH64: Add BTI note to LTO helper library 2023-03-30 11:05:22 +00:00
LinuxBootBootManagerLib ArmPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
OpteeLib ArmPkg/ArmMmuLib: Extend API to manage memory permissions better 2023-06-26 09:11:53 +00:00
PeiServicesTablePointerLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PlatformBootManagerLib ArmPkg: Configure PcdEmuVariableNvModeEnable as a dynamic PCD 2023-05-29 15:14:00 +00:00
SemiHostingDebugLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SemiHostingSerialPortLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SemihostLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
StandaloneMmMmuLib ArmPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GnuNoteBti.bin ArmPkg, BaseTools AARCH64: Add BTI ELF note to .hii objects 2023-03-30 11:05:22 +00:00