• Zachary Amsden's avatar
    [PATCH] vmi: pit override · e30fab3a
    Zachary Amsden authored
    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: default avatarZachary Amsden <zach@vmware.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e30fab3a
time.c 7.44 KB