Module Name:    src
Committed By:   ad
Date:           Sun Jun 14 23:24:20 UTC 2020

Modified Files:
        src/sys/arch/x86/x86: tsc.c

Log Message:
tsc_get_timecount(): disable the "clock goes backwards" check on i386 for
the moment since it requires 64-bit store to be atomic because of nesting
via interrupt.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/x86/x86/tsc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/tsc.c
diff -u src/sys/arch/x86/x86/tsc.c:1.49 src/sys/arch/x86/x86/tsc.c:1.50
--- src/sys/arch/x86/x86/tsc.c:1.49	Sat Jun 13 23:58:52 2020
+++ src/sys/arch/x86/x86/tsc.c	Sun Jun 14 23:24:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tsc.c,v 1.49 2020/06/13 23:58:52 ad Exp $	*/
+/*	$NetBSD: tsc.c,v 1.50 2020/06/14 23:24:20 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.49 2020/06/13 23:58:52 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.50 2020/06/14 23:24:20 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -357,6 +357,7 @@ tsc_delay(unsigned int us)
 static u_int
 tsc_get_timecount(struct timecounter *tc)
 {
+#ifdef _LP64 /* requires atomic 64-bit store */
 	static __cpu_simple_lock_t lock = __SIMPLELOCK_UNLOCKED;
 	static int lastwarn;
 	uint64_t cur, prev;
@@ -385,4 +386,7 @@ tsc_get_timecount(struct timecounter *tc
 	}
 	l->l_md.md_tsc = cur;
 	return (uint32_t)cur;
+#else
+	return cpu_counter32();
+#endif
 }

Reply via email to