Bug 145718

Summary: [est] [patch] fix freq calculation from MSR for CPUs with fractional multipliers
Product: Base System Reporter: Andre.Albsmeier
Component: i386Assignee: freebsd-i386 mailing list <i386>
Status: Open ---    
Severity: Affects Only Me CC: mail
Priority: Normal    
Version: 9.3-RELEASE   
Hardware: Any   
OS: Any   
Description Flags
current version I use on 11-STABLE none

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

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);
@@ -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,
 	/* 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,
 	/* 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 
- Untouched since 2018-01-01.
- Affects Base System OR Documentation


Reset to open status.

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