Commit 241294fe authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Try to avoid LTO bug on arm

There seems to be an issue where LTO inlines the icache flushing method
but removes the save and restore of the r7 register which is clobbered
for the icache flush syscall.
This CL tries to avoid the bug. It's purely speculative, as we cannot
reproduce the exact bug locally.

R=jkummerow@chromium.org

Bug: chromium:952759
Change-Id: I634fc4de3e8c4d1cb649384542c381d925b07a42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571619Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60922}
parent 28705dfb
......@@ -727,9 +727,6 @@ std::unique_ptr<WasmCode> NativeModule::AddCodeWithCodeSpace(
}
}
// Flush the i-cache after relocation.
FlushInstructionCache(dst_code_bytes.start(), 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,
......@@ -740,6 +737,11 @@ 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.start(), 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