The time initialization changed for i386 when some code moved into time_init.
This made it no longer possible to override the PIT / HPET, which broke
paravirt guests.

Subject: Fix PIT override bug for paravirt
Signed-off-by: Zachary Amsden <[EMAIL PROTECTED]>

diff -r acd12d5196c7 arch/i386/kernel/paravirt.c
--- a/arch/i386/kernel/paravirt.c       Thu Feb 01 23:13:18 2007 -0800
+++ b/arch/i386/kernel/paravirt.c       Thu Feb 01 23:19:36 2007 -0800
@@ -497,7 +497,7 @@ struct paravirt_ops paravirt_ops = {
        .memory_setup = machine_specific_memory_setup,
        .get_wallclock = native_get_wallclock,
        .set_wallclock = native_set_wallclock,
-       .time_init = time_init_hook,
+       .time_init = native_time_init,
        .init_IRQ = native_init_IRQ,
 
        .cpuid = native_cpuid,
diff -r acd12d5196c7 arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c   Thu Feb 01 23:13:18 2007 -0800
+++ b/arch/i386/kernel/time.c   Thu Feb 01 23:43:21 2007 -0800
@@ -268,10 +268,17 @@ static void __init hpet_time_init(void)
 {
        if (!hpet_enable())
                setup_pit_timer();
-       do_time_init();
-}
-
+       time_init_hook();
+}
+
+void __init native_time_init(void)
+{
+       late_time_init = hpet_time_init;
+}
+
+#ifndef CONFIG_PARAVIRT
 void __init time_init(void)
 {
-       late_time_init = hpet_time_init;
-}
+       native_time_init();
+}
+#endif
diff -r acd12d5196c7 include/asm-i386/paravirt.h
--- a/include/asm-i386/paravirt.h       Thu Feb 01 23:13:18 2007 -0800
+++ b/include/asm-i386/paravirt.h       Thu Feb 01 23:17:27 2007 -0800
@@ -185,7 +185,7 @@ static inline int set_wallclock(unsigned
        return paravirt_ops.set_wallclock(nowtime);
 }
 
-static inline void do_time_init(void)
+static inline void time_init(void)
 {
        return paravirt_ops.time_init();
 }
diff -r acd12d5196c7 include/asm-i386/time.h
--- a/include/asm-i386/time.h   Thu Feb 01 23:13:18 2007 -0800
+++ b/include/asm-i386/time.h   Thu Feb 01 23:43:29 2007 -0800
@@ -28,13 +28,14 @@ static inline int native_set_wallclock(u
        return retval;
 }
 
+extern void native_time_init(void);
+
 #ifdef CONFIG_PARAVIRT
 #include <asm/paravirt.h>
 #else /* !CONFIG_PARAVIRT */
 
 #define get_wallclock() native_get_wallclock()
 #define set_wallclock(x) native_set_wallclock(x)
-#define do_time_init() time_init_hook()
 
 #endif /* CONFIG_PARAVIRT */
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to