NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/60596: No need to read CPUID if model/family indicated CPU has invariant TSC



>Number:         60596
>Category:       kern
>Synopsis:       No need to read CPUID if model/family indicated CPU has invariant TSC
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 15 08:45:00 +0000 2026
>Originator:     RVP
>Release:        11.99.7
>Organization:
>Environment:
NetBSD CoreBook.local 11.99.7 NetBSD 11.99.7 (COREBOOK_DIAG) #0: Sat Aug 15 04:21:15 UTC 2026  bld@CoreBook.local:/tmp/obj/usr/src/sys/arch/amd64/compile/COREBOOK_DIAG amd64
>Description:
If the CPU model and family indicate a invariant TSC, don't bother
checking the CPUID again. This is a teeny optimization.
>How-To-Repeat:

>Fix:
```
--- sys/arch/x86/x86/tsc.c.orig	2026-03-01 13:57:41.000000000 +0000
+++ sys/arch/x86/x86/tsc.c	2026-03-19 04:50:09.497920788 +0000
@@ -153,6 +153,9 @@
 		}
 	}
 
+	if (invariant)
+		return true;
+
 	/*
 	 * The best way to check whether the TSC counter is invariant or not
 	 * is to check CPUID 80000007.
```




Home | Main Index | Thread Index | Old Index