]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S
ArmPkg/ArmMmuLib AARCH64: get rid of needless TLB invalidation
[mirror_edk2.git] / ArmPkg / Library / ArmMmuLib / AArch64 / ArmMmuLibReplaceEntry.S
index 90192df24f55520dbb2bdf9ce74ff64111c2d2f1..8b447e3d666fd36946b83f77218d50ff68df96c0 100644 (file)
   dmb   sy\r
   dc    ivac, x0\r
 \r
-  // flush the TLBs\r
+  // flush translations for the target address from the TLBs\r
+  lsr   x2, x2, #12\r
   .if   \el == 1\r
-  tlbi  vmalle1\r
+  tlbi  vaae1, x2\r
   .else\r
-  tlbi  alle\el\r
+  tlbi  vae\el, x2\r
   .endif\r
-  dsb   sy\r
+  dsb   nsh\r
 \r
   // re-enable the MMU\r
   msr   sctlr_el\el, x8\r
 //VOID\r
 //ArmReplaceLiveTranslationEntry (\r
 //  IN  UINT64  *Entry,\r
-//  IN  UINT64  Value\r
+//  IN  UINT64  Value,\r
+//  IN  UINT64  Address\r
 //  )\r
 ASM_FUNC(ArmReplaceLiveTranslationEntry)\r
 \r
   // disable interrupts\r
-  mrs   x2, daif\r
+  mrs   x4, daif\r
   msr   daifset, #0xf\r
   isb\r
 \r
   // clean and invalidate first so that we don't clobber\r
   // adjacent entries that are dirty in the caches\r
   dc    civac, x0\r
-  dsb   ish\r
+  dsb   nsh\r
 \r
   EL1_OR_EL2_OR_EL3(x3)\r
 1:__replace_entry 1\r
@@ -69,7 +71,7 @@ ASM_FUNC(ArmReplaceLiveTranslationEntry)
   b     4f\r
 3:__replace_entry 3\r
 \r
-4:msr   daif, x2\r
+4:msr   daif, x4\r
   ret\r
 \r
 ASM_GLOBAL ASM_PFX(ArmReplaceLiveTranslationEntrySize)\r