FreeBSD Bugzilla – Attachment 212294 Details for
Bug 244705
/usr/src/sys/x86/x86/tsc.c: System Clock is 0.3% slow since r352684
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
reverts the breaking change
revert-tsc-1.diff (text/plain), 1.29 KB, created by
Theron Tarigo
on 2020-03-09 23:41:30 UTC
(
hide
)
Description:
reverts the breaking change
Filename:
MIME Type:
Creator:
Theron Tarigo
Created:
2020-03-09 23:41:30 UTC
Size:
1.29 KB
patch
obsolete
>Index: sys/x86/x86/tsc.c >=================================================================== >--- sys/x86/x86/tsc.c (revision 358826) >+++ sys/x86/x86/tsc.c (working copy) >@@ -134,11 +134,7 @@ > > /* > * Calculate TSC frequency using information from the CPUID leaf 0x15 >- * 'Time Stamp Counter and Nominal Core Crystal Clock'. If leaf 0x15 >- * is not functional, as it is on Skylake/Kabylake, try 0x16 'Processor >- * Frequency Information'. Leaf 0x16 is described in the SDM as >- * informational only, but if 0x15 did not work, and TSC calibration >- * is disabled, it is the best we can get at all. It should still be >+ * 'Time Stamp Counter and Nominal Core Crystal Clock'. It should be > * an improvement over the parsing of the CPU model name in > * tsc_freq_intel(), when available. > */ >@@ -150,20 +146,10 @@ > if (cpu_high < 0x15) > return (false); > do_cpuid(0x15, regs); >- if (regs[0] != 0 && regs[1] != 0 && regs[2] != 0) { >- tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; >- return (true); >- } >- >- if (cpu_high < 0x16) >+ if (regs[0] == 0 || regs[1] == 0 || regs[2] == 0) > return (false); >- do_cpuid(0x16, regs); >- if (regs[0] != 0) { >- tsc_freq = (uint64_t)regs[0] * 1000000; >- return (true); >- } >- >- return (false); >+ tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; >+ return (true); > } > > static void
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244705
: 212294