OSDN Git Service

Clarify comment on JIT cache flush issue
authorKevin Brodsky <kevin.brodsky@linaro.org>
Thu, 15 Dec 2016 14:23:09 +0000 (14:23 +0000)
committerKevin Brodsky <kevin.brodsky@linaro.org>
Fri, 10 Feb 2017 15:48:16 +0000 (15:48 +0000)
The original fix (#304947) is needed, but the comment was suggesting a
hardware cause and a link with A53 errata. In all likelihood neither
of these is true, and the issue is actually caused by a kernel issue
affecting many Qualcomm devices (like those using the msm tree).

Change-Id: Ie750e6fd9eb7130982d184c22917b5c3ea4beed0

runtime/jit/jit_code_cache.cc

index f5151b5..0ac388a 100644 (file)
@@ -556,12 +556,13 @@ uint8_t* JitCodeCache::CommitCodeInternal(Thread* self,
       // Flush data cache, as compiled code references literals in it.
       FlushDataCache(reinterpret_cast<char*>(roots_data),
                      reinterpret_cast<char*>(roots_data + data_size));
-      // Flush caches before we remove write permission because on some ARMv8 hardware,
-      // flushing caches require write permissions.
+      // Flush caches before we remove write permission because some ARMv8 Qualcomm kernels may
+      // trigger a segfault if a page fault occurs when requesting a cache maintenance operation.
+      // This is a kernel bug that we need to work around until affected devices (e.g. Nexus 5X and
+      // 6P) stop being supported or their kernels are fixed.
       //
-      // For reference, here are kernel patches discussing about this issue:
-      // https://android.googlesource.com/kernel/msm/%2B/0e7f7bcc3fc87489cda5aa6aff8ce40eed912279
-      // https://patchwork.kernel.org/patch/9047921/
+      // For reference, this behavior is caused by this commit:
+      // https://android.googlesource.com/kernel/msm/+/3fbe6bc28a6b9939d0650f2f17eb5216c719950c
       FlushInstructionCache(reinterpret_cast<char*>(code_ptr),
                             reinterpret_cast<char*>(code_ptr + code_size));
       DCHECK(!Runtime::Current()->IsAotCompiler());