qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH-RFC 0/3] qemu: memory barriers in virtio


From: Paul Brook
Subject: [Qemu-devel] Re: [PATCH-RFC 0/3] qemu: memory barriers in virtio
Date: Tue, 22 Dec 2009 22:58:16 +0000
User-agent: KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; )

> > Given this is supposed to be portable code, I wonder if we should have
> > atomic ordered memory accessors instead.
> >
> > Paul
> 
> Could you clarify please?
> 
> The infiniband bits I used as base are very portable,
> I know they build on a ton of platforms. I just stripped
> a couple of infiniband specific assumptions from there.
> 
> Do you suggest we use __sync_synchronize?
> Unfortunately this is broken or slow on many platforms.
> I do use it when it seems safe or when we see a platform
> we don't know about.

I mean have a single function that does both the atomic load/store and the 
memory barrier. Instead of:

  stw_phys(addr, val)
  barrier();

We do:

  stw_phys_barrier(addr, val).

This avoids issues in the future (multithreaded TCG) where atomic memory 
accesses may be nontrivial.

Paul




reply via email to

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