aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/hyperv_timer.c
diff options
context:
space:
mode:
authorThomas Gleixner <[email protected]>2020-02-07 12:38:54 +0000
committerThomas Gleixner <[email protected]>2020-02-17 13:40:22 +0000
commiteec399dd862762b9594df3659f15839a4e12f17a (patch)
tree2ad42d36c099f2ec9b7eceff537281d0bad7c690 /drivers/clocksource/hyperv_timer.c
parentclocksource: Cleanup struct clocksource and documentation (diff)
downloadkernel-eec399dd862762b9594df3659f15839a4e12f17a.tar.gz
kernel-eec399dd862762b9594df3659f15839a4e12f17a.zip
x86/vdso: Move VDSO clocksource state tracking to callback
All architectures which use the generic VDSO code have their own storage for the VDSO clock mode. That's pointless and just requires duplicate code. X86 abuses the function which retrieves the architecture specific clock mode storage to mark the clocksource as used in the VDSO. That's silly because this is invoked on every tick when the VDSO data is updated. Move this functionality to the clocksource::enable() callback so it gets invoked once when the clocksource is installed. This allows to make the clock mode storage generic. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Michael Kelley <[email protected]> (Hyper-V parts) Reviewed-by: Vincenzo Frascino <[email protected]> (VDSO parts) Acked-by: Juergen Gross <[email protected]> (Xen parts) Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/clocksource/hyperv_timer.c')
-rw-r--r--drivers/clocksource/hyperv_timer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 9d808d595ca8..a86859ccc61b 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -369,6 +369,12 @@ static void resume_hv_clock_tsc(struct clocksource *arg)
hv_set_reference_tsc(tsc_msr);
}
+static int hv_cs_enable(struct clocksource *cs)
+{
+ hv_enable_vdso_clocksource();
+ return 0;
+}
+
static struct clocksource hyperv_cs_tsc = {
.name = "hyperv_clocksource_tsc_page",
.rating = 250,
@@ -377,6 +383,7 @@ static struct clocksource hyperv_cs_tsc = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.suspend= suspend_hv_clock_tsc,
.resume = resume_hv_clock_tsc,
+ .enable = hv_cs_enable,
};
static u64 notrace read_hv_clock_msr(void)