From: Sergey Fedorov Date: Fri, 22 Apr 2016 16:08:51 +0000 (+0300) Subject: tcg/sparc: Make direct jump patching thread-safe X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~6^2~13^2~6^2~271^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84f79fb7c6e857edc807e4a251338243ce0cbac3;p=sdk%2Femulator%2Fqemu.git tcg/sparc: Make direct jump patching thread-safe Ensure direct jump patching in SPARC is atomic by using atomic_read()/atomic_set() for code patching. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Reviewed-by: Alex Bennée Message-Id: <1461341333-19646-10-git-send-email-sergey.fedorov@linaro.org> Signed-off-by: Richard Henderson --- diff --git a/tcg/sparc/tcg-target.inc.c b/tcg/sparc/tcg-target.inc.c index d641cfd8c5..c6479e2507 100644 --- a/tcg/sparc/tcg-target.inc.c +++ b/tcg/sparc/tcg-target.inc.c @@ -1647,6 +1647,6 @@ void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr) the code_gen_buffer can't be larger than 2GB. */ tcg_debug_assert(disp == (int32_t)disp); - *ptr = CALL | (uint32_t)disp >> 2; + atomic_set(ptr, deposit32(CALL, 0, 30, disp >> 2)); flush_icache_range(jmp_addr, jmp_addr + 4); }