[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2/2] x86/time: report correct frequency of Xen PV clocksource
The value of the counter represents the number of nanoseconds since host boot. That means the correct frequency is always 1GHz. This inconsistency caused time to go slower in PV shim on most platforms. Signed-off-by: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx> --- xen/arch/x86/time.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 7e7a62e..95840c4 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -567,27 +567,12 @@ static struct platform_timesource __initdata plt_tsc = */ static uint64_t xen_timer_last; -static uint64_t xen_timer_cpu_frequency(void) -{ - struct vcpu_time_info *info = &this_cpu(vcpu_info)->time; - uint64_t freq; - - freq = 1000000000ULL << 32; - do_div(freq, info->tsc_to_system_mul); - if ( info->tsc_shift < 0 ) - freq <<= -info->tsc_shift; - else - freq >>= info->tsc_shift; - - return freq; -} - static int64_t __init init_xen_timer(struct platform_timesource *pts) { if ( !xen_guest ) return 0; - pts->frequency = xen_timer_cpu_frequency(); + pts->frequency = 1000000000ULL; return pts->frequency; } -- 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |