summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Include
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2022-09-24 18:26:19 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-10-19 09:07:13 +0000
commit0487cac09f23f2f3e3258b903937dc1d45426096 (patch)
tree7f7886c2bf8ed9db28a6933d5983532dfb9a89b7 /ArmPkg/Include
parentab644cfac595608f5c8a65531e410d25f0e94c61 (diff)
downloadedk2-0487cac09f23f2f3e3258b903937dc1d45426096.tar.gz
edk2-0487cac09f23f2f3e3258b903937dc1d45426096.tar.bz2
edk2-0487cac09f23f2f3e3258b903937dc1d45426096.zip
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 <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Diffstat (limited to 'ArmPkg/Include')
-rw-r--r--ArmPkg/Include/Library/ArmMmuLib.h7
1 files changed, 4 insertions, 3 deletions
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