xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	x86@kernel.org, Andy Lutomirski <luto@amacapital.net>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Joao Martins <joao.m.martins@oracle.com>
Subject: [PATCH v7 3/5] x86/xen/time: set pvclock flags on xen_time_init()
Date: Thu, 19 Oct 2017 14:39:16 +0100	[thread overview]
Message-ID: <20171019133918.18367-4-joao.m.martins@oracle.com> (raw)
In-Reply-To: <20171019133918.18367-1-joao.m.martins@oracle.com>

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>
---
Changes since v5:
 * Add Boris RoB

New in v5
---
 arch/x86/xen/time.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 1ecb05db3632..fc0148d3a70d 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -372,6 +372,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;
 
@@ -395,6 +396,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();
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-10-19 13:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171019133918.18367-1-joao.m.martins@oracle.com>
2017-10-19 13:39 ` [PATCH v7 1/5] ptp_kvm: probe for kvm guest availability Joao Martins
2017-10-19 13:39 ` [PATCH v7 2/5] x86/pvclock: add setter for pvclock_pvti_cpu0_va Joao Martins
2017-10-19 13:39 ` Joao Martins [this message]
2017-10-19 13:39 ` [PATCH v7 4/5] x86/xen/time: setup vcpu 0 time info page Joao Martins
2017-10-19 13:39 ` [PATCH v7 5/5] MAINTAINERS: xen, kvm: track pvclock-abi.h changes Joao Martins
     [not found] ` <20171019133918.18367-2-joao.m.martins@oracle.com>
2017-10-20 14:33   ` [PATCH v7 1/5] ptp_kvm: probe for kvm guest availability Radim Krcmar
     [not found] ` <20171019133918.18367-3-joao.m.martins@oracle.com>
2017-11-06 16:09   ` [PATCH v7 2/5] x86/pvclock: add setter for pvclock_pvti_cpu0_va Paolo Bonzini
     [not found]   ` <591d9a46-f96e-b3a6-d412-0267f4e412e5@redhat.com>
2017-11-07 19:29     ` Joao Martins
     [not found]     ` <d3957335-f093-9d64-7f82-f4dc97c38268@oracle.com>
2017-11-08 11:06       ` Thomas Gleixner
     [not found]       ` <alpine.DEB.2.20.1711081203590.1937@nanos>
2017-11-08 13:01         ` Joao Martins
     [not found]         ` <36a22b0a-e745-4f6f-ca9a-fe549aad930e@oracle.com>
2017-11-08 13:10           ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171019133918.18367-4-joao.m.martins@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).