From: Pavel Tatashin <pasha.tatashin@oracle.com>
To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com,
linux@armlinux.org.uk, schwidefsky@de.ibm.com,
heiko.carstens@de.ibm.com, john.stultz@linaro.org,
sboyd@codeaurora.org, x86@kernel.org,
linux-kernel@vger.kernel.org, mingo@redhat.com,
tglx@linutronix.de, hpa@zytor.com, douly.fnst@cn.fujitsu.com
Subject: [PATCH v8 5/6] x86/paravirt: add active_sched_clock to pv_time_ops
Date: Wed, 8 Nov 2017 22:02:00 -0500 [thread overview]
Message-ID: <20171109030201.5991-6-pasha.tatashin@oracle.com> (raw)
In-Reply-To: <20171109030201.5991-1-pasha.tatashin@oracle.com>
Early boot clock might differ from the clock that is used later on,
therefore add a new field to pv_time_ops, that shows currently active
clock. If platform supports early boot clock, this field will be changed
to use that clock early in boot, and later will be replaced with the
permanent clock.
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
---
arch/x86/include/asm/paravirt_types.h | 1 +
arch/x86/kernel/paravirt.c | 1 +
arch/x86/xen/time.c | 7 ++++---
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 6ec54d01972d..96518f027c15 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -98,6 +98,7 @@ struct pv_lazy_ops {
struct pv_time_ops {
unsigned long long (*sched_clock)(void);
unsigned long long (*steal_clock)(int cpu);
+ unsigned long long (*active_sched_clock)(void);
} __no_randomize_layout;
struct pv_cpu_ops {
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 041096bdef86..91af9e6b913b 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -320,6 +320,7 @@ struct pv_init_ops pv_init_ops = {
struct pv_time_ops pv_time_ops = {
.sched_clock = native_sched_clock,
.steal_clock = native_steal_clock,
+ .active_sched_clock = native_sched_clock,
};
__visible struct pv_irq_ops pv_irq_ops = {
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 80c2a4bdf230..fdd241748dc8 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -408,8 +408,8 @@ static void __init xen_time_init(void)
void __ref xen_init_time_ops(void)
{
- pv_time_ops = xen_time_ops;
-
+ pv_time_ops.sched_clock = xen_time_ops.sched_clock;
+ pv_time_ops.steal_clock = xen_time_ops.steal_clock;
x86_init.timers.timer_init = xen_time_init;
x86_init.timers.setup_percpu_clockev = x86_init_noop;
x86_cpuinit.setup_percpu_clockev = x86_init_noop;
@@ -450,7 +450,8 @@ void __init xen_hvm_init_time_ops(void)
return;
}
- pv_time_ops = xen_time_ops;
+ pv_time_ops.sched_clock = xen_time_ops.sched_clock;
+ pv_time_ops.steal_clock = xen_time_ops.steal_clock;
x86_init.timers.setup_percpu_clockev = xen_time_init;
x86_cpuinit.setup_percpu_clockev = xen_hvm_setup_cpu_clockevents;
--
2.15.0
next prev parent reply other threads:[~2017-11-09 3:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 3:01 [PATCH v8 0/6] Early boot time stamps for x86 Pavel Tatashin
2017-11-09 3:01 ` [PATCH v8 1/6] x86/tsc: remove tsc_disabled flag Pavel Tatashin
2017-11-13 3:52 ` Dou Liyang
2017-11-13 18:51 ` Pavel Tatashin
2017-11-09 3:01 ` [PATCH v8 2/6] time: sync read_boot_clock64() with persistent clock Pavel Tatashin
2017-11-13 3:47 ` Dou Liyang
2017-11-14 19:57 ` Pavel Tatashin
2017-11-15 2:47 ` Dou Liyang
2017-11-15 3:56 ` Pavel Tatashin
2017-11-09 3:01 ` [PATCH v8 3/6] x86/time: read_boot_clock64() implementation Pavel Tatashin
2017-11-09 3:01 ` [PATCH v8 4/6] sched: early boot clock Pavel Tatashin
2017-11-09 3:02 ` Pavel Tatashin [this message]
2017-11-09 3:02 ` [PATCH v8 6/6] x86/tsc: use tsc early Pavel Tatashin
2017-11-13 3:47 ` Dou Liyang
2017-11-14 21:46 ` Pavel Tatashin
2017-11-15 3:53 ` Dou Liyang
2017-11-15 16:01 ` Pavel Tatashin
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=20171109030201.5991-6-pasha.tatashin@oracle.com \
--to=pasha.tatashin@oracle.com \
--cc=daniel.m.jordan@oracle.com \
--cc=douly.fnst@cn.fujitsu.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mingo@redhat.com \
--cc=sboyd@codeaurora.org \
--cc=schwidefsky@de.ibm.com \
--cc=steven.sistare@oracle.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®