summarylogtreecommitdiffstats
path: root/0012_loongson_force_cache_flush.patch
blob: 6211e6cc6e2cc0645fa15d0d0536c8709c310c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: Forced whole instruction cache flushing on Loongson.
 Workaround for instruction cache flushing malfunction on Loongson systems
 that occasionally cause failures under stress test conditions.
Author: Dusan Milosavljevic <dusan.milosavljevic@rt-rk.com>
Origin:upstream,https://github.com/paul99/v8m-rb/commit/ded6c2c2.patch
Last-Update: 2012-06-13
--- a/src/mips/cpu-mips.cc
+++ b/src/mips/cpu-mips.cc
@@ -72,6 +72,13 @@
 #else  // ANDROID
   int res;
   // See http://www.linux-mips.org/wiki/Cacheflush_Syscall.
+  if (kArchVariant==kLoongson) {
+    // Force flushing of whole instruction cache on Loongson. This is a
+    // workaround for problem when under stress tests cache lines are not
+    // flushed through syscall for some reasons.
+    size_t iCacheSize = 64 * KB;
+    size = iCacheSize + 1;
+  }
   res = syscall(__NR_cacheflush, start, size, ICACHE);
   if (res) {
     V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache");