FreeBSD-SA-06:14.fpu
Colin Percival
cperciva at freebsd.org
Mon May 1 05:13:14 UTC 2006
> David Xu wrote:
>> Probably it should only be applied to AMD CPU but not Intel and others,
>> it is easy to check cpu vendor and put a
>> if (bug_fxsave)
>> fpu_clean_state();
>> in file npx.c.
The problem with doing something like this is that the branch will
almost never be in the processor's branch prediction tables, so you
will get a branch mis-prediction on the unaffected processors --
which is likely to be more expensive than simply running the state
cleaning code.
Rostislav Krasny wrote:
> Other possible solution is making the fpu_clean_state() optional by
> something like following:
>
> #ifdef BUG_FXSAVE
> #define fpu_clean_state() __fpu_clean_state()
> #else
> #define fpu_clean_state() ;
> #endif
>
> ... and including "options BUG_FXSAVE" to GENERIC.
Yes, this is probably the right solution. My priority was to fix the
bug; optimizing performance comes second.
Colin Percival
More information about the freebsd-current
mailing list