]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/xen/time.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / arch / x86 / xen / time.c
index dfd6db69ead5072dd5a7430ad4750285d44d7031..c39e1a5aa241bcce2cb2a070d2dbbe391a28ae31 100644 (file)
@@ -105,6 +105,12 @@ static void get_runstate_snapshot(struct vcpu_runstate_info *res)
        } while (get64(&state->state_entry_time) != state_time);
 }
 
+/* return true when a vcpu could run but has no real cpu to run on */
+bool xen_vcpu_stolen(int vcpu)
+{
+       return per_cpu(runstate, vcpu).state == RUNSTATE_runnable;
+}
+
 static void setup_runstate_info(int cpu)
 {
        struct vcpu_register_runstate_memory_area area;
@@ -211,17 +217,17 @@ unsigned long long xen_sched_clock(void)
 /* Get the CPU speed from Xen */
 unsigned long xen_cpu_khz(void)
 {
-       u64 cpu_khz = 1000000ULL << 32;
+       u64 xen_khz = 1000000ULL << 32;
        const struct vcpu_time_info *info =
                &HYPERVISOR_shared_info->vcpu_info[0].time;
 
-       do_div(cpu_khz, info->tsc_to_system_mul);
+       do_div(xen_khz, info->tsc_to_system_mul);
        if (info->tsc_shift < 0)
-               cpu_khz <<= -info->tsc_shift;
+               xen_khz <<= -info->tsc_shift;
        else
-               cpu_khz >>= info->tsc_shift;
+               xen_khz >>= info->tsc_shift;
 
-       return cpu_khz;
+       return xen_khz;
 }
 
 /*
@@ -586,7 +592,7 @@ __init void xen_time_init(void)
        set_normalized_timespec(&wall_to_monotonic,
                                -xtime.tv_sec, -xtime.tv_nsec);
 
-       tsc_disable = 0;
+       setup_force_cpu_cap(X86_FEATURE_TSC);
 
        xen_setup_timer(cpu);
        xen_setup_cpu_clockevents();