> > 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