-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ArmPkg: ArmMmuLib: Pre-Allocate Page Table Memory
Allocating memory when memory protection is active can cause the below infinite loop: 1. gCpu->SetMemoryAttributes(EFI_MEMORY_RO) 2. ArmSetMemoryAttributes () 3. SetMemoryRegionAttribute() 4. UpdateRegionMapping() 5. UpdateRegionMappingRecursive() 6. AllocatePages() -> Need memory for a translation table entry 7. CoreAllocatePages() 8. ApplyMemoryProtectionPolicy() -> Policy says new page should be XN 9. gCpu->SetMemoryAttributes() 10. Back to 3 To fix this previously, CpuDxe would update conventional memory to be XN prior to installing the CpuArch protocol. However, when we transition to setting EFI_MEMORY_RP on free memory, this will no longer work. This PR updates ArmMmuLib to reserve page table memory for allocation during table spits to prevent the infinite loop. It also updates the consumers of ArmMmuLib to consume the PEI version of the lib in the same commit so as to not break them. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Oliver Smith-Denny <[email protected]>
- Loading branch information
1 parent
f962adc
commit 97397c5
Showing
18 changed files
with
389 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.