lkml.org 
[lkml]   [2008]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03 of 36] x86: add memory barriers to wrmsr
Arjan van de Ven wrote:
>>>
>> 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.
>

Actually, I believe the barrier(); before is actually incorrect, since
it would affect the wrmsr() register arguments rather than the wrmsr
instruction itself.

-hpa


\
 
 \ /
  Last update: 2008-06-26 01:57    [W:0.476 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site