Re: [systemd-devel] rdrand generated with march=winchip-c6 in systemd-241

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 18, 2019 at 06:40:16PM -0400, tedheadster wrote:
> On Sat, May 18, 2019 at 5:30 PM Segher Boessenkool
> <segher@xxxxxxxxxxxxxxxxxxx> wrote:
> > That won't help, the compiler will remove those dead stores.
> >
> > Add a
> >
> >   asm("" ::: "memory");
> >
> > between these two lines?
> 
> This didn't seem to do anything:

[ snip ]

Apparently nothing is actually in memory, I thought you would force that.
Oh well.

Something like

  *__ebx = *__ecx = *__edx = 0;
  asm volatile("" : "+r"(*__eax), "+r"(*__ebx), "+r"(*__ecx), "+r"(*__edx));
  __cpuid (__leaf, *__eax, *__ebx, *__ecx, *__edx);

should do the trick.


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux