From 0487cac09f23f2f3e3258b903937dc1d45426096 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Sat, 24 Sep 2022 18:26:19 +0200 Subject: ArmPkg/ArmMmuLib: Disable and re-enable MMU only when needed When updating a page table descriptor in a way that requires break before make, we temporarily disable the MMU to ensure that we don't unmap the memory region that the code itself is executing from. However, this is a condition we can check in a straight-forward manner, and if the regions are disjoint, we don't have to bother with the MMU controls, and we can just perform an ordinary break before make. Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPkg/Include/Library/ArmMmuLib.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ArmPkg/Include') diff --git a/ArmPkg/Include/Library/ArmMmuLib.h b/ArmPkg/Include/Library/ArmMmuLib.h index 7538a8274a..b745e2230e 100644 --- a/ArmPkg/Include/Library/ArmMmuLib.h +++ b/ArmPkg/Include/Library/ArmMmuLib.h @@ -52,9 +52,10 @@ ArmClearMemoryRegionReadOnly ( VOID EFIAPI ArmReplaceLiveTranslationEntry ( - IN UINT64 *Entry, - IN UINT64 Value, - IN UINT64 RegionStart + IN UINT64 *Entry, + IN UINT64 Value, + IN UINT64 RegionStart, + IN BOOLEAN DisableMmu ); EFI_STATUS -- cgit v1.2.3