Bug 145718 - [est] [patch] fix freq calculation from MSR for CPUs with fractional multipliers
Summary: [est] [patch] fix freq calculation from MSR for CPUs with fractional multipliers
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: i386 (show other bugs)
Version: 9.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-i386 (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-04-15 09:40 UTC by Andre.Albsmeier
Modified: 2022-10-17 12:37 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.10 KB, patch)
2010-04-15 09:40 UTC, Andre.Albsmeier
no flags Details | Diff
current version I use on 11-STABLE (1.85 KB, patch)
2018-05-29 05:08 UTC, Andre Albsmeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre.Albsmeier 2010-04-15 09:40:00 UTC
When calculating the simple rate table in est_msr_info()
we have to observe bit 6 (0x40) of the multiplier which
denotes an additional 0.5 for the value. Examples:

FID	Multiplier
--------------------
0x06	6
0x07	7
0x08	8
0x46	6.5
0x47	7.5
0x48	8.5

How-To-Repeat: 
Enable cpufreq on a cpu with a fractional multiplier (in
my case a Q9550 which uses 8.5), set hw.est.msr_info=1,
and watch dmesg spitting out insane low/high values for
the bus clock.
Comment 1 Andre.Albsmeier 2013-04-26 17:34:30 UTC
And another additional patch to make this work with an E6600 CPU
(266 MHz clock). While we are here, fix the unit of the voltage
as well (Mv -> mV).

--- est.c.ORI	2013-04-26 18:30:02.000000000 +0200
+++ est.c	2013-04-26 18:30:02.000000000 +0200
@@ -1192,6 +1192,7 @@
 	switch (bus) {
 	case 100:
 	case 133:
+	case 267:
 	case 333:
 		return (1);
 	default:
@@ -1252,7 +1253,7 @@
 	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. */
@@ -1269,7 +1270,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. */
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:41:06 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 3 Andre Albsmeier 2018-05-29 05:08:19 UTC
Created attachment 193806 [details]
current version I use on 11-STABLE
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:37:07 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>