Fix from: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* If we configured ourselves for a TSC, we'd better have one!
*/
#ifdef CONFIG_X86_TSC
* If we configured ourselves for a TSC, we'd better have one!
*/
#ifdef CONFIG_X86_TSC
- if (!cpu_has_tsc && !tsc_disable)
panic("Kernel compiled for Pentium+, requires TSC feature!");
#endif
panic("Kernel compiled for Pentium+, requires TSC feature!");
#endif
* we do "generic changes."
*/
* we do "generic changes."
*/
- /* TSC disabled? */
- if ( tsc_disable )
- clear_bit(X86_FEATURE_TSC, c->x86_capability);
-
/* If the model name is still unset, do table lookup. */
if ( !c->x86_model_id[0] ) {
char *p;
/* If the model name is still unset, do table lookup. */
if ( !c->x86_model_id[0] ) {
char *p;
if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
- if (tsc_disable && cpu_has_tsc) {
- printk(KERN_NOTICE "Disabling TSC...\n");
- /**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/
- clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability);
- }
load_idt(&idt_descr);
switch_to_new_gdt();
load_idt(&idt_descr);
switch_to_new_gdt();
{
if (num_online_nodes() > 1) {
printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
{
if (num_online_nodes() > 1) {
printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
+ setup_clear_cpu_cap(X86_FEATURE_TSC);
unsigned int tsc_khz;
EXPORT_SYMBOL_GPL(tsc_khz);
unsigned int tsc_khz;
EXPORT_SYMBOL_GPL(tsc_khz);
#ifdef CONFIG_X86_TSC
static int __init tsc_setup(char *str)
{
#ifdef CONFIG_X86_TSC
static int __init tsc_setup(char *str)
{
*/
static int __init tsc_setup(char *str)
{
*/
static int __init tsc_setup(char *str)
{
+ setup_clear_cpu_cap(X86_FEATURE_TSC);
- if (!cpu_has_tsc || tsc_disable)
goto out_no_tsc;
cpu_khz = calculate_cpu_khz();
goto out_no_tsc;
cpu_khz = calculate_cpu_khz();
- /*
- * Set the tsc_disable flag if there's no TSC support, this
- * makes it a fast flag for the kernel to see whether it
- * should be using the TSC.
- */
- tsc_disable = 1;
+ setup_clear_cpu_cap(X86_FEATURE_TSC);
{
/* Voyagers run their CPUs from independent clocks, so disable
* the TSC code because we can't sync them */
{
/* Voyagers run their CPUs from independent clocks, so disable
* the TSC code because we can't sync them */
+ setup_clear_cpu_cap(X86_FEATURE_TSC);
}
void __init trap_init_hook(void)
}
void __init trap_init_hook(void)
set_normalized_timespec(&wall_to_monotonic,
-xtime.tv_sec, -xtime.tv_nsec);
set_normalized_timespec(&wall_to_monotonic,
-xtime.tv_sec, -xtime.tv_nsec);
+ setup_force_cpu_cap(X86_FEATURE_TSC);
xen_setup_timer(cpu);
xen_setup_cpu_clockevents();
xen_setup_timer(cpu);
xen_setup_cpu_clockevents();
clear_cpu_cap(&boot_cpu_data, bit); \
set_bit(bit, cleared_cpu_caps); \
} while (0)
clear_cpu_cap(&boot_cpu_data, bit); \
set_bit(bit, cleared_cpu_caps); \
} while (0)
+#define setup_force_cpu_cap(bit) do { \
+ set_cpu_cap(&boot_cpu_data, bit); \
+ clear_bit(bit, cleared_cpu_caps); \
+} while (0)
#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU)
#define cpu_has_vme boot_cpu_has(X86_FEATURE_VME)
#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU)
#define cpu_has_vme boot_cpu_has(X86_FEATURE_VME)
extern unsigned int cpu_khz;
extern unsigned int tsc_khz;
extern unsigned int cpu_khz;
extern unsigned int tsc_khz;
-/* flag for disabling the tsc */
-extern int tsc_disable;
extern void disable_TSC(void);
extern void disable_TSC(void);