Re: [PATCH] lguest-fix-divide-error-implement-sched_clock

From: Andi Kleen
Date: Tue Jun 05 2007 - 12:41:43 EST


On Tuesday 05 June 2007 18:16, H. Peter Anvin wrote:

> Yes. Since there is now a mechanism to get a clean message out, it
> seemed like a good idea to extend the benefit of static determination.
> Andi already had in his tree -- and I copied it -- code to deal with
> stuff like "cpu_has_tsc" as a compile-time constant, eliminating the
> "else" clause.
>
> Depending on the configuration it affects FPU, TSC, 3Dnow.

I don't think it's a good idea for the TSC. There are various
setups where it is unreliable and also often simulators don't
implement it correctly. And it's always a valuable workaround
to be able to turn it off.

Except possibly for the FPU only features used by the gcc output
should be tested this way. For everything else it is better to
test at runtime.

That is x86-64 makes some more assumptions. But even it
doesn't assume TSC.

I added the mechanism to statically evaluate mostly to share cpufeatures.h
between 32bit and 64bit at some point -- but didn't quite finish that work
before the last merge.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/