[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/11] tcg/mips: Make direct jump patching threa
From: |
Sergey Fedorov |
Subject: |
Re: [Qemu-devel] [PATCH 10/11] tcg/mips: Make direct jump patching thread-safe |
Date: |
Thu, 7 Apr 2016 19:09:44 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 07/04/16 19:01, Paolo Bonzini wrote:
>
> On 07/04/2016 17:53, Sergey Fedorov wrote:
>> 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>
>> ---
>> 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..e65835d2096b 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_write(ptr, deposit32(insn, 0, 26, addr >> 2));
> Oops. :)
>
> Paolo
Nice catch! I think I just didn't cross-compile it for MIPS...
Thanks,
Sergey
>
>> flush_icache_range(jmp_addr, jmp_addr + 4);
>> }
- Re: [Qemu-devel] [PATCH 02/11] pc-bios/s390-ccw: Use correct strip when cross-compiling, (continued)
[Qemu-devel] [PATCH 07/11] tcg/arm: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/07
[Qemu-devel] [PATCH 04/11] tcg/ppc: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/07
[Qemu-devel] [PATCH 11/11] tcg: Note requirement on atomic direct jump patching, Sergey Fedorov, 2016/04/07
[Qemu-devel] [PATCH 08/11] tcg/aarch64: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/07
[Qemu-devel] [PATCH 09/11] tcg/sparc: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/07
[Qemu-devel] [PATCH 10/11] tcg/mips: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/07
Re: [Qemu-devel] [PATCH 00/11] tcg: Make direct jump patching thread-safe, Sergey Fedorov, 2016/04/07
Re: [Qemu-devel] [PATCH 00/11] tcg: Make direct jump patching thread-safe, Alex Bennée, 2016/04/20