qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: peter.maydell@linaro.org, rth@twiddle.net, qemu-devel@nongnu.org,
	mttcg@listserver.greensocs.com, fred.konrad@greensocs.com,
	a.rigo@virtualopensystems.com, cota@braap.org,
	bobby.prani@gmail.com, nikunj@linux.vnet.ibm.com,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v1 1/3] cputlb: ensure tbl_set_dirty1 updates addr_write atomically
Date: Mon, 20 Mar 2017 16:16:20 +0000	[thread overview]
Message-ID: <87k27jore3.fsf@linaro.org> (raw)
In-Reply-To: <fb507927-7be0-9901-8657-02455e0af46d@redhat.com>


Paolo Bonzini <pbonzini@redhat.com> writes:

> On 20/03/2017 16:34, Alex Bennée wrote:
>>  static inline void tlb_set_dirty1(CPUTLBEntry *tlb_entry, target_ulong vaddr)
>>  {
>> +#if TCG_OVERSIZED_GUEST
>>      if (tlb_entry->addr_write == (vaddr | TLB_NOTDIRTY)) {
>>          tlb_entry->addr_write = vaddr;
>>      }
>> +#else
>> +    uintptr_t orig_addr = atomic_mb_read(&tlb_entry->addr_write);
>
> atomic_read is enough, since we don't care at all about cases where the
> address doesn't match.  Otherwise

Good catch. Will fix for my pullreq

>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
>
> Paolo
>
>> +    if (orig_addr == (vaddr | TLB_NOTDIRTY)) {
>> +        atomic_cmpxchg(&tlb_entry->addr_write, orig_addr, vaddr);
>> +    }
>> +#endif
>>  }


--
Alex Bennée

  reply	other threads:[~2017-03-20 16:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 15:34 [Qemu-devel] [PATCH v1 0/3] MTTCG regression fixes for 2.9-rc1 Alex Bennée
2017-03-20 15:34 ` [Qemu-devel] [PATCH v1 1/3] cputlb: ensure tbl_set_dirty1 updates addr_write atomically Alex Bennée
2017-03-20 15:43   ` Paolo Bonzini
2017-03-20 16:16     ` Alex Bennée [this message]
2017-03-20 21:49   ` Richard Henderson
2017-03-20 15:34 ` [Qemu-devel] [PATCH v1 2/3] user-exec: handle synchronous signals from QEMU gracefully Alex Bennée
2017-03-20 21:52   ` Richard Henderson
2017-03-20 15:34 ` [Qemu-devel] [PATCH v1 3/3] bsd-user: align use of mmap_lock to that of linux-user Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k27jore3.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=a.rigo@virtualopensystems.com \
    --cc=bobby.prani@gmail.com \
    --cc=cota@braap.org \
    --cc=crosthwaite.peter@gmail.com \
    --cc=fred.konrad@greensocs.com \
    --cc=mttcg@listserver.greensocs.com \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).