[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/11] tcg/mips: Make direct jump patching thread
From: |
Sergey Fedorov |
Subject: |
[Qemu-devel] [PATCH v2 10/11] tcg/mips: Make direct jump patching thread-safe |
Date: |
Fri, 22 Apr 2016 19:08:52 +0300 |
From: Sergey Fedorov <address@hidden>
Ensure direct jump patching in MIPS is atomic by using
atomic_read()/atomic_set() for code patching.
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
---
Changes in v2:
* s/atomic_write/atomic_set/
tcg/mips/tcg-target.inc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c
index 682e19897db0..cefc0398018a 100644
--- a/tcg/mips/tcg-target.inc.c
+++ b/tcg/mips/tcg-target.inc.c
@@ -1886,6 +1886,7 @@ static void tcg_target_init(TCGContext *s)
void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr)
{
uint32_t *ptr = (uint32_t *)jmp_addr;
- *ptr = deposit32(*ptr, 0, 26, addr >> 2);
+ uint32_t insn = atomic_read(ptr);
+ atomic_set(ptr, deposit32(insn, 0, 26, addr >> 2));
flush_icache_range(jmp_addr, jmp_addr + 4);
}
--
2.8.1
- [Qemu-devel] [PATCH v2 00/11] tcg: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 02/11] include/qemu/osdep.h: Add macros for pointer alignment, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 01/11] include/qemu/osdep.h: Add a macro to check for alignment, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 03/11] tci: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 04/11] tcg/ppc: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 05/11] tcg/i386: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 08/11] tcg/aarch64: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 11/11] tcg: Note requirement on atomic direct jump patching, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 06/11] tcg/s390: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
- [Qemu-devel] [PATCH v2 10/11] tcg/mips: Make direct jump patching thread-safe,
Sergey Fedorov <=
- Re: [Qemu-devel] [PATCH v2 10/11] tcg/mips: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
[Qemu-devel] [PATCH v2 07/11] tcg/arm: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
[Qemu-devel] [PATCH v2 09/11] tcg/sparc: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/22
Re: [Qemu-devel] [PATCH v2 00/11] tcg: Make direct jump patching thread-safe, Richard Henderson, 2016/04/24