lkml.org 
[lkml]   [2011]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] x86, intel: Output microcode revision v2
On 05/25/2011 03:32 PM, Andi Kleen wrote:
> From: Andi Kleen<ak@linux.intel.com>
>

[...]

>
> I had to add a memory barrier to native_cpuid to prevent it being
> optimized away when the result is not used.
>

[...]

> @@ -179,7 +181,8 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
> "=b" (*ebx),
> "=c" (*ecx),
> "=d" (*edx)
> - : "0" (*eax), "2" (*ecx));
> + : "0" (*eax), "2" (*ecx)
> + : "memory");
> }
>

[...]

> + cpuid_eax(1);

I'm confused. Doesn't "asm volatile" (in native_cpuid) mean "don't
optimize me out"?

I can't reproduce the disappearance of the cpuid instruction when I
copied and pasted all the macros.

--Andy


\
 
 \ /
  Last update: 2011-05-26 02:01    [W:0.845 / U:2.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site