FreeBSD Bugzilla – Attachment 193806 Details for
Bug 145718
[est] [patch] fix freq calculation from MSR for CPUs with fractional multipliers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
current version I use on 11-STABLE
est.c.diff (text/plain), 1.85 KB, created by
Andre Albsmeier
on 2018-05-29 05:08:19 UTC
(
hide
)
Description:
current version I use on 11-STABLE
Filename:
MIME Type:
Creator:
Andre Albsmeier
Created:
2018-05-29 05:08:19 UTC
Size:
1.85 KB
patch
obsolete
>--- est.c.ORI 2016-12-27 14:33:56.000000000 +0100 >+++ est.c 2018-05-29 07:07:21.219581000 +0200 >@@ -1192,6 +1192,8 @@ > switch (bus) { > case 100: > case 133: >+ case 166: >+ case 267: > case 333: > return (1); > default: >@@ -1217,12 +1219,16 @@ > /* Figure out the bus clock. */ > freq = atomic_load_acq_64(&tsc_freq) / 1000000; > id = msr >> 32; >- bus = freq / (id >> 8); >+ bus = (freq + (id >> 9)) / (id >> 8); >+ if( id & 0x4000 ) >+ bus = 2 * freq / ( (id >> 7 & 0x7e) + 1 ); > device_printf(dev, "Guessed bus clock (high) of %d MHz\n", bus); > if (!bus_speed_ok(bus)) { > /* We may be running on the low frequency. */ > id = msr >> 48; > bus = freq / (id >> 8); >+ if( id & 0x4000 ) >+ bus = 2 * freq / ( (id >> 7 & 0x7e) + 1 ); > device_printf(dev, "Guessed bus clock (low) of %d MHz\n", bus); > if (!bus_speed_ok(bus)) > return (EOPNOTSUPP); >@@ -1230,6 +1236,8 @@ > /* Calculate high frequency. */ > id = msr >> 32; > freq = ((id >> 8) & 0xff) * bus; >+ if( id & 0x4000 ) >+ freq =( (id >> 7 & 0x7e) + 1 ) * bus / 2; > } > > /* Fill out a new freq table containing just the high and low freqs. */ >@@ -1246,12 +1254,14 @@ > fp[0].volts = volts; > fp[0].id16 = id; > fp[0].power = CPUFREQ_VAL_UNKNOWN; >- device_printf(dev, "Guessed high setting of %d MHz @ %d Mv\n", freq, >+ device_printf(dev, "Guessed high setting of %d MHz @ %d mV\n", freq, > volts); > > /* Second, the low frequency. */ > id = msr >> 48; > freq = ((id >> 8) & 0xff) * bus; >+ if( id & 0x4000 ) >+ freq =( (id >> 7 & 0x7e) + 1 ) * bus / 2; > volts = id & 0xff; > if (volts != 0) { > volts <<= 4; >@@ -1261,7 +1271,7 @@ > fp[1].volts = volts; > fp[1].id16 = id; > fp[1].power = CPUFREQ_VAL_UNKNOWN; >- device_printf(dev, "Guessed low setting of %d MHz @ %d Mv\n", freq, >+ device_printf(dev, "Guessed low setting of %d MHz @ %d mV\n", freq, > volts); > > /* Table is already terminated due to M_ZERO. */
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 145718
:
105294
| 193806