[PATCH v4 5/8] accel/tcg: Fix overwrite problems of tcg_cflags

Weiwei Li posted 8 patches 2 years, 10 months ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liweiwei@iscas.ac.cn>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
There is a newer version of this series
[PATCH v4 5/8] accel/tcg: Fix overwrite problems of tcg_cflags
Posted by Weiwei Li 2 years, 10 months ago
CPUs often set CF_PCREL in tcg_cflags before qemu_init_vcpu(), in which
tcg_cflags will be overwrited by tcg_cpu_init_cflags().

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
---
 accel/tcg/tcg-accel-ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index af35e0d092..58c8e64096 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -59,7 +59,7 @@ void tcg_cpu_init_cflags(CPUState *cpu, bool parallel)
 
     cflags |= parallel ? CF_PARALLEL : 0;
     cflags |= icount_enabled() ? CF_USE_ICOUNT : 0;
-    cpu->tcg_cflags = cflags;
+    cpu->tcg_cflags |= cflags;
 }
 
 void tcg_cpus_destroy(CPUState *cpu)
-- 
2.25.1
Re: [PATCH v4 5/8] accel/tcg: Fix overwrite problems of tcg_cflags
Posted by Richard Henderson 2 years, 10 months ago
On 3/31/23 08:06, Weiwei Li wrote:
> CPUs often set CF_PCREL in tcg_cflags before qemu_init_vcpu(), in which
> tcg_cflags will be overwrited by tcg_cpu_init_cflags().
> 
> Signed-off-by: Weiwei Li<liweiwei@iscas.ac.cn>
> Signed-off-by: Junqiang Wang<wangjunqiang@iscas.ac.cn>
> ---
>   accel/tcg/tcg-accel-ops.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Re: [PATCH v4 5/8] accel/tcg: Fix overwrite problems of tcg_cflags
Posted by Richard Henderson 2 years, 10 months ago
On 3/31/23 18:18, Richard Henderson wrote:
> On 3/31/23 08:06, Weiwei Li wrote:
>> CPUs often set CF_PCREL in tcg_cflags before qemu_init_vcpu(), in which
>> tcg_cflags will be overwrited by tcg_cpu_init_cflags().
>>
>> Signed-off-by: Weiwei Li<liweiwei@iscas.ac.cn>
>> Signed-off-by: Junqiang Wang<wangjunqiang@iscas.ac.cn>
>> ---
>>   accel/tcg/tcg-accel-ops.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Fixes: 4be790263ffc ("accel/tcg: Replace `TARGET_TB_PCREL` with `CF_PCREL`")


r~



Re: [PATCH v4 5/8] accel/tcg: Fix overwrite problems of tcg_cflags
Posted by Richard Henderson 2 years, 10 months ago
On 3/31/23 18:33, Richard Henderson wrote:
> On 3/31/23 18:18, Richard Henderson wrote:
>> On 3/31/23 08:06, Weiwei Li wrote:
>>> CPUs often set CF_PCREL in tcg_cflags before qemu_init_vcpu(), in which
>>> tcg_cflags will be overwrited by tcg_cpu_init_cflags().
>>>
>>> Signed-off-by: Weiwei Li<liweiwei@iscas.ac.cn>
>>> Signed-off-by: Junqiang Wang<wangjunqiang@iscas.ac.cn>
>>> ---
>>>   accel/tcg/tcg-accel-ops.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> 
> Fixes: 4be790263ffc ("accel/tcg: Replace `TARGET_TB_PCREL` with `CF_PCREL`")

Queued to tcg-next.


r~