summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-10-12 14:05:51 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-10-12 14:05:51 +0000
commit60faef353dc5b79266d37cde2af2f1652f49430b (patch)
treeb9476cd5d900ec59b0a7e1955410206e715f37b8
parent1cc0262dcd676d4a508fd401b08cfd0211beaee9 (diff)
Disable TSC debug printfs for release. They can be turned back on by
defining TSC_DEBUG. ok deraadt@
-rw-r--r--sys/arch/amd64/amd64/cpu.c6
-rw-r--r--sys/arch/amd64/amd64/tsc.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c
index 024958c63b2..f65f0364fc4 100644
--- a/sys/arch/amd64/amd64/cpu.c
+++ b/sys/arch/amd64/amd64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.141 2019/09/06 12:13:41 deraadt Exp $ */
+/* $OpenBSD: cpu.c,v 1.142 2019/10/12 14:05:50 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -890,7 +890,9 @@ cpu_start_secondary(struct cpu_info *ci)
wbinvd();
tsc_sync_bp(ci);
intr_restore(s);
+#ifdef TSC_DEBUG
printf("TSC skew=%lld\n", (long long)ci->ci_tsc_skew);
+#endif
}
if ((ci->ci_flags & CPUF_IDENTIFIED) == 0) {
@@ -937,8 +939,10 @@ cpu_boot_secondary(struct cpu_info *ci)
tsc_sync_bp(ci);
intr_restore(s);
drift -= ci->ci_tsc_skew;
+#ifdef TSC_DEBUG
printf("TSC skew=%lld drift=%lld\n",
(long long)ci->ci_tsc_skew, (long long)drift);
+#endif
tsc_sync_drift(drift);
}
}
diff --git a/sys/arch/amd64/amd64/tsc.c b/sys/arch/amd64/amd64/tsc.c
index a0e9586d5a3..3abf1392841 100644
--- a/sys/arch/amd64/amd64/tsc.c
+++ b/sys/arch/amd64/amd64/tsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsc.c,v 1.14 2019/09/06 13:10:44 kettenis Exp $ */
+/* $OpenBSD: tsc.c,v 1.15 2019/10/12 14:05:50 kettenis Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
* Copyright (c) 2016,2017 Reyk Floeter <reyk@openbsd.org>
@@ -216,8 +216,10 @@ tsc_get_timecount(struct timecounter *tc)
void
tsc_timecounter_init(struct cpu_info *ci, uint64_t cpufreq)
{
+#ifdef TSC_DEBUG
printf("%s: TSC skew=%lld observed drift=%lld\n", __func__,
(long long)ci->ci_tsc_skew, (long long)tsc_drift_observed);
+#endif
if (!(ci->ci_flags & CPUF_PRIMARY) ||
!(ci->ci_flags & CPUF_CONST_TSC) ||