MultiArchUefiPkg
MultiArchUefiPkg copied to clipboard
Add EFI wrappers for SetMemoryAttributes, AllocatePages, AllocatePool
Catch/filter SetMemoryAttributes to ignore any attempts to change attributes for the emulated image itself, as on architectures that use no-exec protection, this would lead to a crash.
Also, technically would also need to wrap AllocatePages and track attempts to allocate code regions (so that these can be protected).
Not a driver use case, but a correctness one.
This includes EFI_CPU_ARCH_PROTOCOL SetMemoryAttributes and the entire EFI_MEMORY_ATTRIBUTE_PROTOCOL