On Sat, Jun 20, 2009 at 4:02 AM, Christian Packmann<Christian.Packmann@xxxxxx> wrote: > Haiku will mis-identify many Core2 CPUs, see e.g. > http://dev.haiku-os.org/ticket/3541. This also affects my Core2Quad 9550 > which shows as Core2 Extreme. > > The problem is get_cpu_model_string() in > trunk/headers/private/shared/cpu_type.h > http://svn.berlios.de/viewcvs/haiku/haiku/trunk/headers/private/shared/cpu_type.h?revision=30106&view=markup > > CPU strings are assigned via the processor signature here, but this is not > precise; the signature is determined by a specific die stepping, but the > same dies are often used for different CPU models. > > The only solution I can see for this is using the CPUID brand string > functions 0xx80000002-4 for reading the CPUs brand string and then > processing that string to get something more readable. I've got code for > that which seems to work reasonably well. > > Before: > > AMD Sempron(tm) Processor 3000+ > AMD Athlon(tm) 64 Processor 3200+ > AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ > AMD Phenom(tm) 9950 Quad-Core Processor > Intel(R) Pentium(R) III CPU family 1400MHz > Intel(R) Pentium(R) 4 CPU 2.80GHz > Intel(R) Xeon(TM) CPU 3.20GHz > Intel(R) Pentium(R) M processor 1.70GHz > Intel(R) Core(TM)2 CPU 4300 @ 1.80GHz > Intel (R) Core(Tm)2 CPU T5500 @ 1.66Ghz > Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz > Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz > Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz > Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz > Intel(R) Atom(TM) CPU N270 @ 1.60GHz > VIA Ezra > > After: > > AMD Sempron > AMD Athlon 64 > AMD Athlon 64 X2 > AMD Phenom 9950 > Intel Pentium III > Intel Pentium 4 > Intel Xeon > Intel Pentium M > Intel Core2 4300 > Intel Core2 T5500 > Intel Core2 T7200 > Intel Core2 T9500 > Intel Core2 T9600 > Intel Core2 Q9550 > Intel Atom N270 > VIA Ezra I don't quite understand the reason for having different strings being returned by the code in cpu_type.h. For friendly-name purposes? When porting BOINC recently, I really needed the full brand string to pass to the server as returned by sysinfo (brand string), so I ended up copy/pasting most of the code from sysinfo's CPU detection logic into the Haiku-specific code in BOINC. This obviously is undesirable, but AFAICT, there was no other API for getting this info. Additionally, I needed the string of features which there is no API for either. BOINC servers use all this info to determine what optimized client could/should sent to the individual machine requesting the work. - Urias