qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.
Date: Fri, 26 Jun 2015 18:20:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1


On 26/06/2015 16:47, address@hidden wrote:
> @@ -273,8 +274,9 @@ static TranslationBlock *tb_find_slow(CPUArchState *env,
>      ptb1 = &tcg_ctx.tb_ctx.tb_phys_hash[h];
>      for(;;) {
>          tb = *ptb1;
> -        if (!tb)
> -            goto not_found;
> +        if (!tb) {
> +            return tb;
> +        }

You are dereferencing tb outside the lock. You need a
smp_read_barrier_depends() here, and a smp_wmb() at the beginning of
tb_link_page.

Paolo

>          if (tb->pc == pc &&



reply via email to

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