[compiler-rt] [builtins] [AArch64] Add missing AArch64 data synchronization barrier...
authorStephen Hines <srhines@google.com>
Fri, 11 Jun 2021 09:07:59 +0000 (02:07 -0700)
committerStephen Hines <srhines@google.com>
Fri, 11 Jun 2021 09:13:48 +0000 (02:13 -0700)
https://developer.arm.com/documentation/den0024/a/Caches/Cache-maintenance
covers how to properly clear caches on AArch64, and the builtin
implementation was missing a `dsb ish` after clearing the icache for the
selected range.

Reviewed By: kristof.beyls

Differential Revision: https://reviews.llvm.org/D104094

compiler-rt/lib/builtins/clear_cache.c

index 5a443dd..0284cb6 100644 (file)
@@ -126,6 +126,7 @@ void __clear_cache(void *start, void *end) {
          addr += icache_line_size)
       __asm __volatile("ic ivau, %0" ::"r"(addr));
   }
+  __asm __volatile("dsb ish");
   __asm __volatile("isb sy");
 #elif defined(__powerpc64__)
   const size_t line_size = 32;