lkml.org 
[lkml]   [2010]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: fix ordering constraints on crX read/writes
On 07/15/2010 03:28 AM, Zachary Amsden wrote:
>> static inline void native_write_cr2(unsigned long val)
>> {
>> - asm volatile("mov %0,%%cr2": : "r" (val), "m" (__force_order));
>> + asm volatile("mov %1,%%cr2": "+m" (__force_order) : "r" (val) :
>> "memory");
>> }
>
>
> You don't need the memory clobber there. Technically, this should
> never be used, however.

kvm writes cr2 in order to present the correct value to the guest. It
doesn't use native_write_cr2(), however.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.



\
 
 \ /
  Last update: 2010-07-15 09:11    [W:0.446 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site