diff options
author | Zachary Amsden <zach@vmware.com> | 2007-03-05 03:30:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-05 10:57:52 -0500 |
commit | e30fab3ad34aa8bfb55c9f0337d4a92a0595f41f (patch) | |
tree | 7c38e6060ce0f1f02b43454585f1c14e524e9fa7 /include/asm-i386 | |
parent | eda08b1befaabcdfea1a9216ae13f9065e69baa7 (diff) |
[PATCH] vmi: pit override
The time_init_hook in paravirt-ops no longer functions in the correct manner
after the integration of the hrtimers code. The problem is that now the call
path for time initialization is:
time_init :
late_time_init = hpet_time_init;
late_time_init -> hpet_time_init:
setup_pit_timer (BAD)
do_time_init --> (via paravirt.h)
time_init_hook --> (via arch_hooks.h)
time_init_hook (in SUBARCH/setup.c)
If this isn't confusing enough, the paravirt case goes through an indirect
function pointer in the paravirt-ops table. The problem is, by the time the
paravirt hook is called, the pit timer is already enabled.
But paravirt guests have their own timer, and don't want to use the PIT.
Rather than intensify the struggle for power going on here, just make it all
nice and simple and just unconditionally do all timer setup in the
late_time_init hook. This also has the advantage of enabling timers in the
same place in all code paths, so everyone has the same bugs and we don't have
outliers who break other code because they turn on timer too early or too
late.
So the paravirt-ops time init function is now by default hpet_time_init, which
is the time init function used for native hardware. Paravirt guests have the
chance to override this when they setup the paravirt-ops table, and should
need no change.
Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/paravirt.h | 4 | ||||
-rw-r--r-- | include/asm-i386/time.h | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h index 1e4226a85263..f8319cae2ac5 100644 --- a/include/asm-i386/paravirt.h +++ b/include/asm-i386/paravirt.h | |||
@@ -186,9 +186,9 @@ static inline int set_wallclock(unsigned long nowtime) | |||
186 | return paravirt_ops.set_wallclock(nowtime); | 186 | return paravirt_ops.set_wallclock(nowtime); |
187 | } | 187 | } |
188 | 188 | ||
189 | static inline void do_time_init(void) | 189 | static inline void (*choose_time_init(void))(void) |
190 | { | 190 | { |
191 | return paravirt_ops.time_init(); | 191 | return paravirt_ops.time_init; |
192 | } | 192 | } |
193 | 193 | ||
194 | /* The paravirtualized CPUID instruction. */ | 194 | /* The paravirtualized CPUID instruction. */ |
diff --git a/include/asm-i386/time.h b/include/asm-i386/time.h index ea8065af825a..eac011366dc2 100644 --- a/include/asm-i386/time.h +++ b/include/asm-i386/time.h | |||
@@ -28,13 +28,16 @@ static inline int native_set_wallclock(unsigned long nowtime) | |||
28 | return retval; | 28 | return retval; |
29 | } | 29 | } |
30 | 30 | ||
31 | extern void (*late_time_init)(void); | ||
32 | extern void hpet_time_init(void); | ||
33 | |||
31 | #ifdef CONFIG_PARAVIRT | 34 | #ifdef CONFIG_PARAVIRT |
32 | #include <asm/paravirt.h> | 35 | #include <asm/paravirt.h> |
33 | #else /* !CONFIG_PARAVIRT */ | 36 | #else /* !CONFIG_PARAVIRT */ |
34 | 37 | ||
35 | #define get_wallclock() native_get_wallclock() | 38 | #define get_wallclock() native_get_wallclock() |
36 | #define set_wallclock(x) native_set_wallclock(x) | 39 | #define set_wallclock(x) native_set_wallclock(x) |
37 | #define do_time_init() time_init_hook() | 40 | #define choose_time_init() hpet_time_init |
38 | 41 | ||
39 | #endif /* CONFIG_PARAVIRT */ | 42 | #endif /* CONFIG_PARAVIRT */ |
40 | 43 | ||