[VD][RISCV] Fix SIGILL when run WASM program 79/318179/3
authorzuowei <wei0622.zuo@samsung.com>
Wed, 25 Sep 2024 08:25:23 +0000 (16:25 +0800)
committerBot Blink <blinkbot@samsung.com>
Wed, 25 Sep 2024 10:10:01 +0000 (10:10 +0000)
On PontusV, flush icache locally will have a cache sync
delay between different HARTs. This will cause SIGILL when
running WASM program(JetStream 2.2 gcc-loops-wasm).

Call flush all can fix it.

Change-Id: Ifb5230653b008043600aeec2744bb7cdbec83f2f

v8/src/codegen/riscv/cpu-riscv.cc

index 613c54439a59fb657f99e73f53b6735c353f40b6..2cb9b2f8efae928ad141c38ba188ba2f8c1d8c20 100644 (file)
@@ -24,7 +24,12 @@ void CpuFeatures::FlushICache(void* start, size_t size) {
   // identify the flush_icache system call, while __NR_riscv_flush_icache is the
   // corresponding system call number used in the kernel to dispatch the system
   // call.
+#ifdef TIZEN_TV_RISCV64
+  // local flush will cause illegal instruction coredump when run wasm program on PontusV.
+  syscall(__NR_riscv_flush_icache, start, end, 0);
+#else
   syscall(__NR_riscv_flush_icache, start, end, 1);
+#endif  // TIZEN_TV_RISCV64
 #endif  // !USE_SIMULATOR.
 }