Messages in this thread | | | Date | Wed, 25 May 2011 19:58:26 -0400 | From | Andy Lutomirski <> | Subject | Re: [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
| |