[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a51e996d48ac9fa0a1260a3822a14f3d570d3be7@git.kernel.org>
Date: Thu, 4 Oct 2018 14:05:06 -0700
From: tip-bot for Thomas Gleixner <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: luto@...nel.org, linux-kernel@...r.kernel.org,
peterz@...radead.org, tglx@...utronix.de, john.stultz@...aro.org,
pbonzini@...hat.com, arnd@...db.de, kys@...rosoft.com,
mingo@...nel.org, fweimer@...hat.com, matt@...trans.com.au,
vkuznets@...hat.com, sboyd@...nel.org, hpa@...or.com,
jgross@...e.com
Subject: [tip:x86/vdso] x86/vdso: Enforce 64bit clocksource
Commit-ID: a51e996d48ac9fa0a1260a3822a14f3d570d3be7
Gitweb: https://git.kernel.org/tip/a51e996d48ac9fa0a1260a3822a14f3d570d3be7
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Mon, 17 Sep 2018 14:45:36 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 4 Oct 2018 23:00:25 +0200
x86/vdso: Enforce 64bit clocksource
All VDSO clock sources are TSC based and use CLOCKSOURCE_MASK(64). There is
no point in masking with all FF. Get rid of it and enforce the mask in the
sanity checker.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Andy Lutomirski <luto@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Matt Rickard <matt@...trans.com.au>
Cc: Stephen Boyd <sboyd@...nel.org>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Florian Weimer <fweimer@...hat.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: devel@...uxdriverproject.org
Cc: virtualization@...ts.linux-foundation.org
Cc: Paolo Bonzini <pbonzini@...hat.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Juergen Gross <jgross@...e.com>
Link: https://lkml.kernel.org/r/20180917130707.151963007@linutronix.de
---
arch/x86/entry/vdso/vclock_gettime.c | 2 +-
arch/x86/kernel/time.c | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/entry/vdso/vclock_gettime.c b/arch/x86/entry/vdso/vclock_gettime.c
index e48ca3afa091..6a950854034f 100644
--- a/arch/x86/entry/vdso/vclock_gettime.c
+++ b/arch/x86/entry/vdso/vclock_gettime.c
@@ -201,7 +201,7 @@ notrace static inline u64 vgetsns(int *mode)
#endif
else
return 0;
- v = (cycles - gtod->cycle_last) & gtod->mask;
+ v = cycles - gtod->cycle_last;
return v * gtod->mult;
}
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
index 1fa632e0829f..b23f5420b26a 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
@@ -120,4 +120,10 @@ void clocksource_arch_init(struct clocksource *cs)
cs->name, cs->archdata.vclock_mode);
cs->archdata.vclock_mode = VCLOCK_NONE;
}
+
+ if (cs->mask != CLOCKSOURCE_MASK(64)) {
+ pr_warn("clocksource %s registered with invalid mask %016llx. Disabling vclock.\n",
+ cs->name, cs->mask);
+ cs->archdata.vclock_mode = VCLOCK_NONE;
+ }
}
Powered by blists - more mailing lists