timecounting: tc_reset_quality: print notice if active counter changes
authorcheloha <cheloha@openbsd.org>
Sun, 18 Sep 2022 20:47:09 +0000 (20:47 +0000)
committercheloha <cheloha@openbsd.org>
Sun, 18 Sep 2022 20:47:09 +0000 (20:47 +0000)
Give the user a hint as to what happened if they boot up and the TSC
is not the active counter.

"sure" deraadt@

sys/kern/kern_tc.c

index b89170a..3509b8f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_tc.c,v 1.77 2022/08/12 02:20:36 cheloha Exp $ */
+/*     $OpenBSD: kern_tc.c,v 1.78 2022/09/18 20:47:09 cheloha Exp $ */
 
 /*
  * Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org>
@@ -486,6 +486,8 @@ tc_reset_quality(struct timecounter *tc, int quality)
                if (best != tc) {
                        enqueue_randomness(best->tc_get_timecount(best));
                        timecounter = best;
+                       printf("timecounter: active counter changed: %s -> %s\n",
+                           tc->tc_name, best->tc_name);
                }
        }
 }