Commit 6df6884
committed
Attempt to fix JIT icache coherency on Arm64
The JIT compiler was experiencing intermittent failures on Arm64/Apple
Silicon due to missing instruction cache invalidation after patching
branch instructions. When update_branch_imm() modified branch targets
in JIT-compiled code, the CPU's icache wasn't being invalidated, causing
it to execute stale cached instructions instead of the newly patched
ones.
This manifested as non-deterministic test failures, particularly in
compute-intensive benchmarks like the pi calculation test.
The fix adds sys_icache_invalidate() after memcpy() in update_branch_imm
to ensure the icache is synchronized with the data cache after code
modification. This is critical on Arm64 cores which have separate L1
instruction and data caches.1 parent d22b787 commit 6df6884
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
| 614 | + | |
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
| |||
2229 | 2230 | | |
2230 | 2231 | | |
2231 | 2232 | | |
| 2233 | + | |
2232 | 2234 | | |
2233 | 2235 | | |
2234 | 2236 | | |
| |||
0 commit comments