qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 13/15] tcg: ensure cpu_tb_exec/tb_gen_code us


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 13/15] tcg: ensure cpu_tb_exec/tb_gen_code use atomic_read/write
Date: Mon, 3 Oct 2016 10:43:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0


On 30/09/2016 23:31, Alex Bennée wrote:
>      tb = atomic_rcu_read(&cpu->tb_jmp_cache[tb_jmp_cache_hash_func(pc)]);
> -    if (unlikely(!tb || tb->pc != pc || tb->cs_base != cs_base ||
> -                 tb->flags != flags)) {
> +    if (unlikely(!tb || atomic_read(&tb->pc) != pc || 
> atomic_read(&tb->cs_base) != cs_base ||
> +                 atomic_read(&tb->flags) != flags)) {

This should not be necessary (and is responsible for the 64-on-32
compilation failure).  The load of tb from the cache is an acquire
operation, and synchronizes with the corresponding store in
cpu->tb_jmp_cache.

Paolo



reply via email to

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