lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <4C7FB9E30200007800013F5E@vpn.id2.novell.com>
Date:	Thu, 02 Sep 2010 13:51:15 +0100
From:	"Jan Beulich" <JBeulich@...ell.com>
To:	<mingo@...e.hu>, <tglx@...utronix.de>, <hpa@...or.com>
Cc:	<linux-kernel@...r.kernel.org>
Subject: [PATCH] x86: adjust setting of tsc_unstable

Directly setting tsc_unstable (as done by unsynchronized_tsc() and
dmi_mark_tsc_unstable()) isn't correct, as it doesn't enforce the
(side) effect of altering clocksource_tsc, thus still allowing this
clock source to be monitored by the watchdog, eventually leading to a
"clocksource unstable" message.

unsynchronized_tsc(), according to all its other return paths, really
should leave calling of mark_tsc_unstable() to its caller.

dmi_mark_tsc_unstable() should call mark_tsc_unstable() itself.

Signed-off-by: Jan Beulich <jbeulich@...ell.com>

---
 arch/x86/include/asm/tsc.h |    2 +-
 arch/x86/kernel/tsc.c      |    8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

--- linux-2.6.36-rc3/arch/x86/include/asm/tsc.h
+++ 2.6.36-rc3-x86-mark-tsc-unstable/arch/x86/include/asm/tsc.h
@@ -46,7 +46,7 @@ static __always_inline cycles_t vget_cyc
 }
 
 extern void tsc_init(void);
-extern void mark_tsc_unstable(char *reason);
+extern void mark_tsc_unstable(const char *reason);
 extern int unsynchronized_tsc(void);
 extern int check_tsc_unstable(void);
 extern unsigned long native_calibrate_tsc(void);
--- linux-2.6.36-rc3/arch/x86/kernel/tsc.c
+++ 2.6.36-rc3-x86-mark-tsc-unstable/arch/x86/kernel/tsc.c
@@ -796,7 +796,7 @@ static struct clocksource clocksource_ts
 #endif
 };
 
-void mark_tsc_unstable(char *reason)
+void mark_tsc_unstable(const char *reason)
 {
 	if (!tsc_unstable) {
 		tsc_unstable = 1;
@@ -816,9 +816,7 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);
 
 static int __init dmi_mark_tsc_unstable(const struct dmi_system_id *d)
 {
-	printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
-			d->ident);
-	tsc_unstable = 1;
+	mark_tsc_unstable(d->ident);
 	return 0;
 }
 
@@ -874,7 +872,7 @@ __cpuinit int unsynchronized_tsc(void)
 	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
 		/* assume multi socket systems are not synchronized: */
 		if (num_possible_cpus() > 1)
-			tsc_unstable = 1;
+			return 1;
 	}
 
 	return tsc_unstable;



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ