[haiku-development] Re: Major CPUID revamp, rfc

  • From: Alexander von Gluck <kallisti5@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Sat, 02 Jun 2012 09:03:00 -0500

On 02.06.2012 01:22, pulkomandy wrote:
On Fri, Jun 01, 2012 at 07:26:37PM -0500, Alexander von Gluck wrote:
I guess moving the family before the vendor (only on amd?) would be
another way to solve this..

(E.xtended  V.endor  F.amily  M.odel)

Original (Intel):       EE VV FM
Original (AMD + other):    VV FM
New AMD chips:       FF MM VV 00  ?

That would limit the changes (no Intel changes at all or vendor mask
changes), and allow us to get the needed data.

This is mostly all to cover AMD expecting you to be able to identify
cpu's based on 1 byte fields:
  (extended family + family) , (extended model << 4) + family

What makes this a hard call is that normally I would just do FF VV
FM to keep the format consistent... but we need 8 bits
for the cpu model. Another option would be just shoving the full
CPUID in there, however the vendor ID is right in the middle of
the CPUID processor family.

What I'd do is show the full CPUID (I guess that matches the original
format ?), then provide macros or methods or something like that to
getFamily, getVendor, getFeatures from a cpuid number.

I wish we *could* use the stock CPUID, however here is why we can't

* The Vendor is a different 1 byte register on the cpu (EAX=0)
* The CPUID is 1 byte with the following fields (EAX=1)

  3:0 - Stepping
  7:4 - Model
 11:8 - Family
 13:12 - Processor Type
 15:14 - Reserved
 19:16 - Extended Model
 27:20 - Extended Family

* Our cpu id register is:

  3:0 - Model
  7:4 - Family
 23:16 - Vendor ID (0x10 for Intel, 0x11 for AMD, etc)

I'm guessing why Be did this was that when they wrote BeOS CPU's generally had
simple CPUID numbers of 612, 35D, etc. (taking just the Family and Model)

We could keep it simple and shift Family and model over 4 and just use the extended
fields:

EF EM VV F M

AMD does recommend adding (+) Extended Family and Family, and combining (<< 4) Extended Model and Model for identification purposes although I guess we don't *have* to do that as long
as we can get extended family and model data in the MSBs of the Haiku CPUID.

 -- Alex

Other related posts: