diff options
author | Joao Martins <joao.m.martins@oracle.com> | 2017-11-08 20:19:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-31 10:13:47 +0300 |
commit | 4f3498a06330cfddc29a7876738eca7a497c81e7 (patch) | |
tree | 6912d16b137ceb596776c7db5b54392372a13a24 | |
parent | 9a12f78a86fc17af6f8326ffb991a931c34b82b9 (diff) | |
download | linux-4f3498a06330cfddc29a7876738eca7a497c81e7.tar.xz |
x86/xen/time: set pvclock flags on xen_time_init()
commit b888808093113ae7d63d213272d01fea4b8329ed upstream.
Specifically check for PVCLOCK_TSC_STABLE_BIT and if this bit is set,
then set it too on pvclock flags. This allows Xen clocksource to use it
and thus speeding up xen_clocksource_read() callers (i.e. sched_clock())
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/x86/xen/time.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 80c2a4bdf230..5687be6f5ca5 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -373,6 +373,7 @@ static const struct pv_time_ops xen_time_ops __initconst = { static void __init xen_time_init(void) { + struct pvclock_vcpu_time_info *pvti; int cpu = smp_processor_id(); struct timespec tp; @@ -396,6 +397,14 @@ static void __init xen_time_init(void) setup_force_cpu_cap(X86_FEATURE_TSC); + /* + * We check ahead on the primary time info if this + * bit is supported hence speeding up Xen clocksource. + */ + pvti = &__this_cpu_read(xen_vcpu)->time; + if (pvti->flags & PVCLOCK_TSC_STABLE_BIT) + pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT); + xen_setup_runstate_info(cpu); xen_setup_timer(cpu); xen_setup_cpu_clockevents(); |