Re: [Xen-devel] [PATCH] Cleanup rmb()/wmb() usage

Keir Fraser
2005-02-23T07:18:14Z

On 23 Feb 2005, at 03:38, Anthony Liguori wrote:

> This is a pretty simple patch to use the read/write barriers defined
> in asm/system.h instead of using hardcoded versions in various places
> throughout Xen.
>
> I''ve checked and using asm/system.h generates the same code on my
> system.  I also tested xcs and it seems to work fine.  I haven''t
> tested blktap but again, it''s generating the same code.

asm/system.h is a private kernel header so should not be directly
included from user space. Inlcuding it may not work for all versions of
Linux, or for other architectures.

We should probably merge the barrier defs we have scattered in the
tools directory into one low-level architectural header that we include
everywhere, and extend for x86/64, ia64, and so on.

> Right now, wmb() is defined as a NOP on any 386 architecture.  Some
> Intel clones require a non-NOP wmb().   Using asm/system.h ensures we
> do the right thing.

Only Centaur clones that have been set up by the kernel to do write
combining. Xen does not ever enable write-combining on normal RAM and
so a barrier is never required.

  -- Keir