These should all probably depend on EMBEDDED (which is the "allow
features to be disabled which would be dangerous for most people".)
CONFIG_X86_TSC, however, would be cleaner implemented by something like:
#ifdef CONFIG_X86_TSC
int disable_tsc;
#else
#define disable_tsc 1
#endif
... then gcc will optimize out the rest of the code.
The CPUID stuff hacks up the code quite a bt which makes it hard to
read. Can you abstract any of that code so it doesn't get so ugly?
Stuff like:
+#ifndef CONFIG_X86_DONT_CPUID
if (cpu_has_fxsr) {
/*
* Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
@@ -1177,6 +1178,7 @@
set_in_cr4(X86_CR4_OSXMMEXCPT);
printk("done.\n");
}
+#endif
... is much better handled by forcing the value of the cpu_has_* macros
to zero, in which case gcc optimizes out the if clause. The current git
HEAD has handling of constant cpu_* going the other way, but it should
be easy enough to extend.
-hpa
-