]> git.proxmox.com Git - mirror_edk2.git/commit
ArmPkg/ArmMmuLib: Disable and re-enable MMU only when needed
authorArd Biesheuvel <ardb@kernel.org>
Sat, 24 Sep 2022 16:26:19 +0000 (18:26 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 Oct 2022 09:07:13 +0000 (09:07 +0000)
commit0487cac09f23f2f3e3258b903937dc1d45426096
tree7f7886c2bf8ed9db28a6933d5983532dfb9a89b7
parentab644cfac595608f5c8a65531e410d25f0e94c61
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>
ArmPkg/Include/Library/ArmMmuLib.h
ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S