qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v4 28/28] cputlb: make tlb_flush_by_mmuidx safe fo


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC v4 28/28] cputlb: make tlb_flush_by_mmuidx safe for MTTCG
Date: Wed, 7 Sep 2016 12:09:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0


On 11/08/2016 17:24, Alex Bennée wrote:
> -        if (atomic_bool_cmpxchg(&cpu->pending_tlb_flush, false, true)) {
> +        if (atomic_mb_read(&cpu->pending_tlb_flush) != ALL_MMUIDX_BITS) {
> +            atomic_mb_set(&cpu->pending_tlb_flush, ALL_MMUIDX_BITS);

This can use atomic_xchg as well.  atomic_bool_cmpxchg seems unnecessary
then.  (Not that I have anything against it, but there are no users yet :)).

Paolo



reply via email to

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