diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-05-19 23:44:12 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-05-23 00:43:21 +0000 |
commit | 5ce29ae84db340244c3c3299f84713a88dec5171 (patch) | |
tree | e1052ca09da8564ba7d36f3ebbef411547a90b95 | |
parent | c5cf7f69c98baed40754ca4a821cb504fd5423cd (diff) | |
download | edk2-5ce29ae84db340244c3c3299f84713a88dec5171.tar.gz edk2-5ce29ae84db340244c3c3299f84713a88dec5171.tar.bz2 edk2-5ce29ae84db340244c3c3299f84713a88dec5171.zip |
ArmPkg/ArmMmuLib AARCH64: Add missing ISB after page table update
The helper that updates live page table entries writes a zero entry,
invalidates the covered address range from the TLBs, and finally writes
the actual entry. This ensures that no TLB conflicts can occur.
Writing the final entry needs to complete before any translations can be
performed, as otherwise, the zero entry, which describes an invalid
translation, may be observed by the page table walker, resulting in a
translation fault. For this reason, the final write is followed by a DSB
barrier instruction.
However, this barrier will not stall the pipeline, and instruction
fetches may still hit this invalid translation, as has been observed and
reported by Oliver. To ensure that the new translation is fully active
before returning from this helper, we have to insert an ISB barrier as
well.
Reported-by: Oliver Steffen <osteffen@redhat.com>
Tested-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r-- | ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S index 887439bc04..1f0d805792 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S @@ -65,6 +65,7 @@ // write updated entry
str x1, [x0]
dsb nshst
+ isb
.L2_\@:
.endm
|