Probing for native availability of isel from userspace
av1474 at comtv.ru
Sun Sep 23 01:37:03 EST 2012
On Sat, 22 Sep 2012, Gabriel Paubert wrote:
> On Sat, Sep 22, 2012 at 02:12:42PM +0400, malc wrote:
> > On Sat, 22 Sep 2012, Segher Boessenkool wrote:
> > > > Is it possible to determine if _native_ isel is available from userspace
> > > > somehow?
> > >
> > > Just try to execute one and catch the SIGILL?
> > >
> > Unfortunately my kernel emulates ISEL for me in this case, so i don't
> > get any SIGILLs.
> Perform a few isels in a loop between a couple of mftb and measure the
> shortest time it takes. Any emulation will take tens of timebase ticks,
> hardware implementation will return very small values, perhaps even
> 0 depending on the relationship between core and timebase frequencies.
> I don't remember whether it's necessary inserting an isync between the
> two mftb. I believe that even on the most OOO machines, two mftb in
> a row will not be reordered to the point that the second executes before
> the first.
Thanks for suggestion, but i'd rather not play with heuristics.
mailto:av1474 at comtv.ru
More information about the Linuxppc-dev