[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1504106628-172372-2-git-send-email-dplotnikov@virtuozzo.com>
Date: Wed, 30 Aug 2017 18:23:43 +0300
From: Denis Plotnikov <dplotnikov@...tuozzo.com>
To: pbonzini@...hat.com, rkrcmar@...hat.com, kvm@...r.kernel.org,
john.stultz@...aro.org, tglx@...utronix.de
Cc: mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org,
x86@...nel.org, rkagan@...tuozzo.com, den@...tuozzo.com
Subject: [PATCH v5 1/6] timekeeper: introduce extended clocksource reading callback
The callback provides extended information about just read
clocksource value.
It's going to be used in cases when detailed system information
needed for further time related values calculation, e.g in KVM
masterclock settings calculation.
Signed-off-by: Denis Plotnikov <dplotnikov@...tuozzo.com>
---
include/linux/clocksource.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index a78cb18..786a522 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -48,7 +48,14 @@ struct module;
* 400-499: Perfect
* The ideal clocksource. A must-use where
* available.
- * @read: returns a cycle value, passes clocksource as argument
+ * @read: returns a cycle value (might be not quite cycles:
+ * see pvclock) passes clocksource as argument
+ * @read_with_stamp: saves cycles value (got from timekeeper) and cycles
+ * stamp (got from hardware counter value and used by
+ * timekeeper to calculate the cycles value) to
+ * corresponding input pointers return true if cycles
+ * stamp holds real cycles and false if it holds some
+ * time derivative value
* @enable: optional function to enable the clocksource
* @disable: optional function to disable the clocksource
* @mask: bitmask for two's complement
@@ -78,6 +85,8 @@ struct module;
*/
struct clocksource {
u64 (*read)(struct clocksource *cs);
+ bool (*read_with_stamp)(struct clocksource *cs,
+ u64 *cycles, u64 *cycles_stamp);
u64 mask;
u32 mult;
u32 shift;
--
2.7.4
Powered by blists - more mailing lists