* [PATCH] Fix booting pentium+ with dodgy TSC
@ 2008-04-06 7:23 Rusty Russell
2008-04-06 11:22 ` Ingo Molnar
2008-04-11 15:43 ` Pavel Machek
0 siblings, 2 replies; 4+ messages in thread
From: Rusty Russell @ 2008-04-06 7:23 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Andi Kleen, H. Anvin, linux-kernel, Ingo Molnar, lguest
Linus please apply. Almost by definition this patch can't make things worse.
We handle a broken tsc these days, so no need to panic. We clear the TSC bit
when tsc_init decides it's unreliable (eg. under lguest w/ bad host TSC),
leading to bogus panic.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff -r 5e0a39f4d07b arch/x86/kernel/cpu/bugs.c
--- a/arch/x86/kernel/cpu/bugs.c Sun Apr 06 13:40:39 2008 +1000
+++ b/arch/x86/kernel/cpu/bugs.c Sun Apr 06 17:14:12 2008 +1000
@@ -143,14 +143,6 @@ static void __init check_config(void)
#endif
/*
- * If we configured ourselves for a TSC, we'd better have one!
- */
-#ifdef CONFIG_X86_TSC
- if (!cpu_has_tsc)
- panic("Kernel compiled for Pentium+, requires TSC feature!");
-#endif
-
-/*
* If we were told we had a good local APIC, check for buggy Pentia,
* i.e. all B steppings and the C2 stepping of P54C when using their
* integrated APIC (see 11AP erratum in "Pentium Processor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix booting pentium+ with dodgy TSC
2008-04-06 7:23 [PATCH] Fix booting pentium+ with dodgy TSC Rusty Russell
@ 2008-04-06 11:22 ` Ingo Molnar
2008-04-06 20:29 ` Rusty Russell
2008-04-11 15:43 ` Pavel Machek
1 sibling, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2008-04-06 11:22 UTC (permalink / raw)
To: Rusty Russell
Cc: Linus Torvalds, Andi Kleen, H. Anvin, linux-kernel, lguest,
Thomas Gleixner
* Rusty Russell <rusty@rustcorp.com.au> wrote:
> Linus please apply. Almost by definition this patch can't make things
> worse.
well, while i agree with the patch it could make things worse. In this
case it can cause code that has been compiled to rely on TSC to
malfunction. For if sched_clock() was using cpu_has_tsc it could return
0 all the time, breaking the scheduler without the user having a clear
idea why it broke. It isnt, and sched_clock() will work fine, but still,
your "this cant make things worse" statement is not completely correct.
In any case:
Acked-by: Ingo Molnar <mingo@elte.hu>
and i've also queued it up into the for-.25 queue of x86.git.
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix booting pentium+ with dodgy TSC
2008-04-06 11:22 ` Ingo Molnar
@ 2008-04-06 20:29 ` Rusty Russell
0 siblings, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2008-04-06 20:29 UTC (permalink / raw)
To: Ingo Molnar
Cc: Linus Torvalds, Andi Kleen, H. Anvin, linux-kernel, lguest,
Thomas Gleixner
On Sunday 06 April 2008 21:22:08 Ingo Molnar wrote:
> * Rusty Russell <rusty@rustcorp.com.au> wrote:
> > Linus please apply. Almost by definition this patch can't make things
> > worse.
>
> well, while i agree with the patch it could make things worse. In this
> case it can cause code that has been compiled to rely on TSC to
> malfunction. For if sched_clock() was using cpu_has_tsc it could return
> 0 all the time, breaking the scheduler without the user having a clear
> idea why it broke. It isnt, and sched_clock() will work fine, but still,
> your "this cant make things worse" statement is not completely correct.
Hence the "almost". It can't break machines, but it could make the problem
harder to diagnose. Given that it will unbreak at least one machine, I'm
reasonably confident it's a win :)
> Acked-by: Ingo Molnar <mingo@elte.hu>
Thanks!
Rusty.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix booting pentium+ with dodgy TSC
2008-04-06 7:23 [PATCH] Fix booting pentium+ with dodgy TSC Rusty Russell
2008-04-06 11:22 ` Ingo Molnar
@ 2008-04-11 15:43 ` Pavel Machek
1 sibling, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2008-04-11 15:43 UTC (permalink / raw)
To: Rusty Russell
Cc: Linus Torvalds, Andi Kleen, H. Anvin, linux-kernel, Ingo Molnar,
lguest
On Sun 2008-04-06 17:23:38, Rusty Russell wrote:
> Linus please apply. Almost by definition this patch can't make things worse.
>
> We handle a broken tsc these days, so no need to panic. We clear the TSC bit
> when tsc_init decides it's unreliable (eg. under lguest w/ bad host TSC),
> leading to bogus panic.
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> diff -r 5e0a39f4d07b arch/x86/kernel/cpu/bugs.c
> --- a/arch/x86/kernel/cpu/bugs.c Sun Apr 06 13:40:39 2008 +1000
> +++ b/arch/x86/kernel/cpu/bugs.c Sun Apr 06 17:14:12 2008 +1000
> @@ -143,14 +143,6 @@ static void __init check_config(void)
> #endif
>
> /*
> - * If we configured ourselves for a TSC, we'd better have one!
> - */
> -#ifdef CONFIG_X86_TSC
> - if (!cpu_has_tsc)
> - panic("Kernel compiled for Pentium+, requires TSC feature!");
> -#endif
> -
CONFIG_X86_TSC means 'cpu has _some_ tsc, rdmsr will work'. If you are
confident noone will read broken tsc, please also remove the config
option. It is meaningless after your patch.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-11 15:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-06 7:23 [PATCH] Fix booting pentium+ with dodgy TSC Rusty Russell
2008-04-06 11:22 ` Ingo Molnar
2008-04-06 20:29 ` Rusty Russell
2008-04-11 15:43 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox