Re: [PATCH 03 of 36] x86: add memory barriers to wrmsr

From: Arjan van de Ven
Date: Wed Jun 25 2008 - 18:32:10 EST


On Wed, 25 Jun 2008 14:08:57 -0700
Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:

> Arjan van de Ven wrote:
> > it's more readable for several of these cases to stick a barrier();
> > in front and after it to be honest; that makes it more explicit that
> > these are deliberate compiler barriers rather than "actual" memory
> > access...
> >
> >
>
> I suppose, though I would be inclined to put the barriers in the
> wrmsr macro itself to act as documentation.


yeah I meant like this:

static inline void native_write_msr(unsigned int msr,
unsigned low, unsigned high)
{
barrier();
asm volatile("wrmsr" : : "c" (msr), "a"(low), "d" (high));
barrier();
}

or in the same in the thing that calls this.

--
If you want to reach me at my work email, use arjan@xxxxxxxxxxxxxxx
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/