qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 06/11] tcg/s390: Make direct jump patching threa


From: Sergey Fedorov
Subject: Re: [Qemu-devel] [PATCH 06/11] tcg/s390: Make direct jump patching thread-safe
Date: Wed, 20 Apr 2016 14:45:18 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 20/04/16 13:01, Alex Bennée wrote:
> Sergey Fedorov <address@hidden> writes:
>> diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
>> index 82399175fe80..e18cc24e50f0 100644
>> --- a/include/exec/exec-all.h
>> +++ b/include/exec/exec-all.h
(snip)
>> @@ -1716,6 +1718,10 @@ static inline void tcg_out_op(TCGContext *s, 
>> TCGOpcode opc,
>>
>>      case INDEX_op_goto_tb:
>>          if (s->tb_jmp_offset) {
>> +            /* align branch displacement for atomic pathing */
> s/pathing/patching/
>
>> +            if (((uintptr_t)s->code_ptr & 3) == 0) {
>> +                tcg_out16(s, NOP);
>> +            }
> Isn't this the wrong way around? Shouldn't we insert the NOP is code_ptr & 3
> == 2 (I assume 1 & 3 are impossible). Or is it that we need to be
> unaligned when we out the jmp so the offset itself is aligned.

Yes, it is the offset itself should be aligned to patch in atomically.

Kind regards,
Sergey

>
>>              tcg_out16(s, RIL_BRCL | (S390_CC_ALWAYS << 4));
>>              s->tb_jmp_offset[args[0]] = tcg_current_code_size(s);
>>              s->code_ptr += 2;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]