Commit 077c897c authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][arm] Cleanup LTO bug avoidance

We landed two mitigations for the bug, and crash data shows that it is
indeed fixed. It is still not clear whether this is a compiler bug,
wrong use of inline assembly, or LTO. The original fix to move the call
to {FlushInstructionCache} should not be needed any more though.
This CL thus reverts https://crrev.com/c/1571619 and uses V8_NOINLINE
instead of the noinline attribute.
If this reintroduces any crashes, please revert. We are far enough away
from the branch to detect this on canary without too much trouble.

R=jkummerow@chromium.org

Bug: chromium:952759
Change-Id: I76f9850d8d6a8af0926b88e961f89df41b662ae7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1611677Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61477}
parent c57e8f14
......@@ -19,10 +19,9 @@
namespace v8 {
namespace internal {
// The inlining of this seems to trigger an LTO bug that clobbers a register on
// arm, see https://crbug.com/952759#c6.
__attribute__((noinline)) void CpuFeatures::FlushICache(void* start,
size_t size) {
// The inlining of this seems to trigger an LTO bug that clobbers a register,
// see https://crbug.com/952759 and https://bugs.llvm.org/show_bug.cgi?id=41575.
V8_NOINLINE void CpuFeatures::FlushICache(void* start, size_t size) {
#if !defined(USE_SIMULATOR)
#if V8_OS_QNX
msync(start, size, MS_SYNC | MS_INVALIDATE_ICACHE);
......
......@@ -884,6 +884,9 @@ std::unique_ptr<WasmCode> NativeModule::AddCodeWithCodeSpace(
}
}
// Flush the i-cache after relocation.
FlushInstructionCache(dst_code_bytes.begin(), dst_code_bytes.size());
std::unique_ptr<WasmCode> code{new WasmCode{
this, index, dst_code_bytes, stack_slots, tagged_parameter_slots,
safepoint_table_offset, handler_table_offset, constant_pool_offset,
......@@ -894,11 +897,6 @@ std::unique_ptr<WasmCode> NativeModule::AddCodeWithCodeSpace(
code->RegisterTrapHandlerData();
// Flush the i-cache for the region holding the relocated code.
// Do this last, as this seems to trigger an LTO bug that clobbers a register
// on arm, see https://crbug.com/952759#c6.
FlushInstructionCache(dst_code_bytes.begin(), dst_code_bytes.size());
return code;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment