aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/tsc.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-12-13 13:14:17 +0000
committerThomas Gleixner <tglx@linutronix.de>2016-12-15 11:44:29 +0100
commit6a369583178d0b89c2c3919c4456ee22fee0f249 (patch)
treeeaaebee6ac4102b724483d19a1c6f920c5406b67 /arch/x86/include/asm/tsc.h
parentx86/tsc: Validate cpumask pointer before accessing it (diff)
downloadlinux-dev-6a369583178d0b89c2c3919c4456ee22fee0f249.tar.xz
linux-dev-6a369583178d0b89c2c3919c4456ee22fee0f249.zip
x86/tsc: Validate TSC_ADJUST after resume
Some 'feature' BIOSes fiddle with the TSC_ADJUST register during suspend/resume which renders the TSC unusable. Add sanity checks into the resume path and restore the original value if it was adjusted. Reported-and-tested-by: Roland Scheidegger <rscheidegger_lists@hispeed.ch> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Bruce Schlobohm <bruce.schlobohm@intel.com> Cc: Kevin Stanton <kevin.b.stanton@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Allen Hung <allen_hung@dell.com> Cc: Borislav Petkov <bp@alien8.de> Link: http://lkml.kernel.org/r/20161213131211.317654500@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/include/asm/tsc.h')
-rw-r--r--arch/x86/include/asm/tsc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index c054eaa7dc94..372ad0cd1357 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -47,12 +47,12 @@ extern int tsc_clocksource_reliable;
*/
#ifdef CONFIG_X86_TSC
extern bool tsc_store_and_check_tsc_adjust(void);
-extern void tsc_verify_tsc_adjust(void);
+extern void tsc_verify_tsc_adjust(bool resume);
extern void check_tsc_sync_source(int cpu);
extern void check_tsc_sync_target(void);
#else
static inline bool tsc_store_and_check_tsc_adjust(void) { return false; }
-static inline void tsc_verify_tsc_adjust(void) { }
+static inline void tsc_verify_tsc_adjust(bool resume) { }
static inline void check_tsc_sync_source(int cpu) { }
static inline void check_tsc_sync_target(void) { }
#endif