1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-16 16:35:45 +00:00

Merge pull request #141 from X0rg/master

Fixes for AMD Zen 2 CPUs
This commit is contained in:
Veselin Georgiev 2020-05-04 21:35:42 +03:00 committed by GitHub
commit 9d22c61611
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 36 additions and 204 deletions

View file

@ -370,7 +370,7 @@ static void decode_amd_cache_info(struct cpu_raw_data_t* raw, struct cpu_id_t* d
{
int l3_result;
const int assoc_table[16] = {
0, 1, 2, 0, 4, 0, 8, 0, 16, 0, 32, 48, 64, 96, 128, 255
0, 1, 2, 0, 4, 0, 8, 0, 16, 16, 32, 48, 64, 96, 128, 255
};
unsigned n = raw->ext_cpuid[0][0];

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[1]=00810f81 00080800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -11,23 +10,12 @@ basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[1]=00810f81 00000000 35c233ff 2fd3fbff
ext_cpuid[2]=20444d41 657a7952 2035206e 30353533
ext_cpuid[2]=20444d41 657a7952 2035206e 30353533
ext_cpuid[3]=69772048 52206874 6f656461 6556206e
ext_cpuid[3]=69772048 52206874 6f656461 6556206e
ext_cpuid[4]=4d206167 6c69626f 66472065 00202078
ext_cpuid[4]=4d206167 6c69626f 66472065 00202078
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 40040140
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 40040140
ext_cpuid[6]=26006400 66006400 02006140 00208140
ext_cpuid[6]=26006400 66006400 02006140 00208140
ext_cpuid[7]=00000000 0000001b 00000000 00006599
ext_cpuid[8]=00003030 00001007 00004007 00000000
@ -52,13 +40,6 @@ ext_cpuid[26]=00000003 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=0001c163 03c0003f 00000fff 00000001
ext_cpuid[29]=0001c163 03c0003f 00000fff 00000001
ext_cpuid[30]=00000000 00000100 00000000 00000000
ext_cpuid[31]=0000000f 0000016f 0000000f 00000000
--------------------------------------------------------------------------------

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[1]=00800f82 00100800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -11,19 +10,10 @@ basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[1]=00800f82 20000000 35c233ff 2fd3fbff
ext_cpuid[2]=20444d41 657a7952 2037206e 30303732
ext_cpuid[2]=20444d41 657a7952 2037206e 30303732
ext_cpuid[3]=69452058 2d746867 65726f43 6f725020
ext_cpuid[3]=69452058 2d746867 65726f43 6f725020
ext_cpuid[4]=73736563 2020726f 20202020 00202020
ext_cpuid[4]=73736563 2020726f 20202020 00202020
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 40040140
ext_cpuid[6]=26006400 66006400 02006140 00808140
@ -50,13 +40,6 @@ ext_cpuid[26]=00000003 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=0001c163 03c0003f 00001fff 00000001
ext_cpuid[29]=0001c163 03c0003f 00001fff 00000001
ext_cpuid[30]=00000000 00000100 00000000 00000000
ext_cpuid[31]=0000000f 0000016f 0000000f 00000000
--------------------------------------------------------------------------------

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[1]=00800f82 00400800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -11,19 +10,10 @@ basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[1]=00800f82 70000000 35c233ff 2fd3fbff
ext_cpuid[2]=20444d41 657a7952 6854206e 64616572
ext_cpuid[2]=20444d41 657a7952 6854206e 64616572
ext_cpuid[3]=70706972 32207265 57303939 32332058
ext_cpuid[3]=70706972 32207265 57303939 32332058
ext_cpuid[4]=726f432d 72502065 7365636f 00726f73
ext_cpuid[4]=726f432d 72502065 7365636f 00726f73
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 40040140
ext_cpuid[6]=36006400 56006400 02006140 0200c140
@ -50,13 +40,6 @@ ext_cpuid[26]=00000003 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=0001c163 03c0003f 00001fff 00000001
ext_cpuid[29]=0001c163 03c0003f 00001fff 00000001
ext_cpuid[30]=00000000 00000100 00000300 00000000
ext_cpuid[31]=0000000f 0000016f 0000000f 00000001
--------------------------------------------------------------------------------

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[1]=00800f12 00400800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -11,19 +10,10 @@ basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[1]=00800f12 40000000 35c233ff 2fd3fbff
ext_cpuid[2]=20444d41 43595045 35353720 33205031
ext_cpuid[2]=20444d41 43595045 35353720 33205031
ext_cpuid[3]=6f432d32 50206572 65636f72 726f7373
ext_cpuid[3]=6f432d32 50206572 65636f72 726f7373
ext_cpuid[4]=20202020 20202020 20202020 00202020
ext_cpuid[4]=20202020 20202020 20202020 00202020
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 40040140
ext_cpuid[6]=36006400 56006400 02006140 0200c140
@ -50,13 +40,6 @@ ext_cpuid[26]=00000003 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=0001c163 03c0003f 00001fff 00000001
ext_cpuid[29]=0001c163 03c0003f 00001fff 00000001
ext_cpuid[30]=00000000 00000100 00000300 00000000
ext_cpuid[31]=0000000f 0000016f 0000000f 00000001
--------------------------------------------------------------------------------

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[1]=00810f10 00080800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -11,19 +10,10 @@ basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[1]=00810f10 20000000 35c233ff 2fd3fbff
ext_cpuid[2]=20444d41 657a7952 2035206e 30303432
ext_cpuid[2]=20444d41 657a7952 2035206e 30303432
ext_cpuid[3]=69772047 52206874 6f656461 6556206e
ext_cpuid[3]=69772047 52206874 6f656461 6556206e
ext_cpuid[4]=47206167 68706172 20736369 00202020
ext_cpuid[4]=47206167 68706172 20736369 00202020
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 40040140
ext_cpuid[6]=26006400 66006400 02006140 00208140
@ -50,13 +40,6 @@ ext_cpuid[26]=00000003 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=0001c163 03c0003f 00000fff 00000001
ext_cpuid[29]=0001c163 03c0003f 00000fff 00000001
ext_cpuid[30]=00000000 00000100 00000000 00000000
ext_cpuid[31]=0000000f 0000016f 0000000f 00000000
--------------------------------------------------------------------------------

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[1]=00800f11 00080800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -11,19 +10,10 @@ basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[1]=00800f11 20000000 35c233ff 2fd3fbff
ext_cpuid[2]=20444d41 657a7952 2035206e 30303531
ext_cpuid[2]=20444d41 657a7952 2035206e 30303531
ext_cpuid[3]=75512058 432d6461 2065726f 636f7250
ext_cpuid[3]=75512058 432d6461 2065726f 636f7250
ext_cpuid[4]=6f737365 20202072 20202020 00202020
ext_cpuid[4]=6f737365 20202072 20202020 00202020
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 40040140
ext_cpuid[6]=26006400 66006400 02006140 00808140
@ -50,13 +40,6 @@ ext_cpuid[26]=00000003 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=0000c163 03c0003f 00001fff 00000001
ext_cpuid[29]=0000c163 03c0003f 00001fff 00000001
ext_cpuid[30]=00000000 00000100 00000000 00000000
ext_cpuid[31]=00000007 0000016f 0000000f 00000000
--------------------------------------------------------------------------------

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[0]=0000000d 68747541 444d4163 69746e65
basic_cpuid[1]=00800f11 00180800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -11,19 +10,10 @@ basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=00000007 00000340 00000340 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[0]=8000001f 68747541 444d4163 69746e65
ext_cpuid[1]=00800f11 70000000 35c233ff 2fd3fbff
ext_cpuid[2]=20444d41 657a7952 6854206e 64616572
ext_cpuid[2]=20444d41 657a7952 6854206e 64616572
ext_cpuid[3]=70706972 31207265 58303239 2d323120
ext_cpuid[3]=70706972 31207265 58303239 2d323120
ext_cpuid[4]=65726f43 6f725020 73736563 0020726f
ext_cpuid[4]=65726f43 6f725020 73736563 0020726f
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 40040140
ext_cpuid[6]=36006400 56006400 02006140 0100a140
@ -50,13 +40,6 @@ ext_cpuid[26]=00000003 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004122 00c0003f 000000ff 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00014163 03c0003f 00001fff 00000001
ext_cpuid[29]=00014163 03c0003f 00001fff 00000001
ext_cpuid[30]=00000000 00000100 00000100 00000000
ext_cpuid[31]=00000007 0000016f 0000000f 00000001
--------------------------------------------------------------------------------

View file

@ -2,7 +2,6 @@ basic_cpuid[0]=00000010 68747541 444d4163 69746e65
basic_cpuid[1]=00870f10 000c0800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
basic_cpuid[4]=00000000 00000000 00000000 00000000
basic_cpuid[5]=00000040 00000040 00000003 00000011
basic_cpuid[6]=00000004 00000000 00000001 00000000
basic_cpuid[7]=00000000 219c91a9 00400004 00000000
@ -12,8 +11,6 @@ basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[11]=00000001 00000002 00000100 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000207 00000340 00000380 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[14]=00000000 00000000 00000000 00000000
basic_cpuid[15]=00000000 000000ff 00000000 00000002
basic_cpuid[16]=00000000 00000002 00000000 00000000
@ -25,7 +22,7 @@ ext_cpuid[4]=20202072 20202020 20202020 00202020
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 20080140
ext_cpuid[6]=48006400 68006400 02006140 01009140
ext_cpuid[7]=00000000 0000001b 00000000 00006799
ext_cpuid[8]=00003030 010ef757 0000700b 00010000
ext_cpuid[8]=00003030 010eb757 0000700b 00010000
ext_cpuid[9]=00000000 00000000 00000000 00000000
ext_cpuid[10]=00000001 00008000 00000000 0013bcff
ext_cpuid[11]=00000000 00000000 00000000 00000000
@ -47,9 +44,6 @@ ext_cpuid[26]=00000006 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 01c0003f 0000003f 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00014163 03c0003f 00003fff 00000001
ext_cpuid[30]=00000000 00000100 00000000 00000000
ext_cpuid[31]=0001000f 0000016f 000001fd 00000001
--------------------------------------------------------------------------------
@ -67,7 +61,7 @@ ext_cpuid[31]=0001000f 0000016f 000001fd 00000001
-1
8
8
0
16
-1
64
64

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=00000010 68747541 444d4163 69746e65
basic_cpuid[0]=00000010 68747541 444d4163 69746e65
basic_cpuid[1]=00870f10 00100800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -10,39 +9,17 @@ basic_cpuid[8]=00000000 00000000 00000000 00000000
basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[11]=00000001 00000002 00000100 00000000
basic_cpuid[11]=00000001 00000002 00000100 00000000
basic_cpuid[11]=00000007 00000010 00000201 00000000
basic_cpuid[11]=00000007 00000010 00000201 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000207 00000340 00000380 00000000
basic_cpuid[13]=00000207 00000340 00000380 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000040 00000340 00000000 00000000
basic_cpuid[13]=00000040 00000340 00000000 00000000
basic_cpuid[14]=00000000 00000000 00000000 00000000
basic_cpuid[15]=00000000 000000ff 00000000 00000002
basic_cpuid[15]=00000000 000000ff 00000000 00000002
basic_cpuid[15]=00000000 00000040 000000ff 00000007
basic_cpuid[15]=00000000 00000040 000000ff 00000007
basic_cpuid[16]=00000000 00000002 00000000 00000000
basic_cpuid[16]=00000000 00000002 00000000 00000000
basic_cpuid[16]=0000000f 00000000 00000004 0000000f
basic_cpuid[16]=0000000f 00000000 00000004 0000000f
ext_cpuid[0]=80000020 68747541 444d4163 69746e65
ext_cpuid[0]=80000020 68747541 444d4163 69746e65
ext_cpuid[1]=00870f10 20000000 75c237ff 2fd3fbff
ext_cpuid[2]=20444d41 657a7952 2037206e 30303733
ext_cpuid[2]=20444d41 657a7952 2037206e 30303733
ext_cpuid[3]=2d382058 65726f43 6f725020 73736563
ext_cpuid[3]=2d382058 65726f43 6f725020 73736563
ext_cpuid[4]=2020726f 20202020 20202020 00202020
ext_cpuid[4]=2020726f 20202020 20202020 00202020
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 20080140
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 20080140
ext_cpuid[6]=48006400 68006400 02006140 01009140
ext_cpuid[6]=48006400 68006400 02006140 01009140
ext_cpuid[7]=00000000 0000001b 00000000 00006799
ext_cpuid[8]=00003030 010eb757 0000700f 00010000
@ -67,13 +44,6 @@ ext_cpuid[26]=00000006 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 01c0003f 0000003f 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=0001c163 03c0003f 00003fff 00000001
ext_cpuid[29]=0001c163 03c0003f 00003fff 00000001
ext_cpuid[30]=00000000 00000100 00000000 00000000
ext_cpuid[31]=0001000f 0000016f 000001fd 00000001
--------------------------------------------------------------------------------
@ -91,7 +61,7 @@ ext_cpuid[31]=0001000f 0000016f 000001fd 00000001
-1
8
8
0
16
-1
64
64

View file

@ -1,5 +1,4 @@
basic_cpuid[0]=00000010 68747541 444d4163 69746e65
basic_cpuid[0]=00000010 68747541 444d4163 69746e65
basic_cpuid[1]=00870f10 00180800 7ed8320b 178bfbff
basic_cpuid[2]=00000000 00000000 00000000 00000000
basic_cpuid[3]=00000000 00000000 00000000 00000000
@ -10,39 +9,17 @@ basic_cpuid[8]=00000000 00000000 00000000 00000000
basic_cpuid[9]=00000000 00000000 00000000 00000000
basic_cpuid[10]=00000000 00000000 00000000 00000000
basic_cpuid[11]=00000001 00000002 00000100 00000000
basic_cpuid[11]=00000001 00000002 00000100 00000000
basic_cpuid[11]=00000007 00000018 00000201 00000000
basic_cpuid[11]=00000007 00000018 00000201 00000000
basic_cpuid[12]=00000000 00000000 00000000 00000000
basic_cpuid[13]=00000207 00000340 00000380 00000000
basic_cpuid[13]=00000207 00000340 00000380 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=0000000f 00000340 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000100 00000240 00000000 00000000
basic_cpuid[13]=00000040 00000340 00000000 00000000
basic_cpuid[13]=00000040 00000340 00000000 00000000
basic_cpuid[14]=00000000 00000000 00000000 00000000
basic_cpuid[15]=00000000 000000ff 00000000 00000002
basic_cpuid[15]=00000000 000000ff 00000000 00000002
basic_cpuid[15]=00000000 00000040 000000ff 00000007
basic_cpuid[15]=00000000 00000040 000000ff 00000007
basic_cpuid[16]=00000000 00000002 00000000 00000000
basic_cpuid[16]=00000000 00000002 00000000 00000000
basic_cpuid[16]=0000000f 00000000 00000004 0000000f
basic_cpuid[16]=0000000f 00000000 00000004 0000000f
ext_cpuid[0]=80000020 68747541 444d4163 69746e65
ext_cpuid[0]=80000020 68747541 444d4163 69746e65
ext_cpuid[1]=00870f10 20000000 75c237ff 2fd3fbff
ext_cpuid[2]=20444d41 657a7952 2039206e 30303933
ext_cpuid[2]=20444d41 657a7952 2039206e 30303933
ext_cpuid[3]=32312058 726f432d 72502065 7365636f
ext_cpuid[3]=32312058 726f432d 72502065 7365636f
ext_cpuid[4]=20726f73 20202020 20202020 00202020
ext_cpuid[4]=20726f73 20202020 20202020 00202020
ext_cpuid[2]=20444d41 657a7952 2039206e 204f5250
ext_cpuid[3]=30303933 2d323120 65726f43 6f725020
ext_cpuid[4]=73736563 2020726f 20202020 00202020
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 20080140
ext_cpuid[5]=ff40ff40 ff40ff40 20080140 20080140
ext_cpuid[6]=48006400 68006400 02006140 02009140
ext_cpuid[6]=48006400 68006400 02006140 02009140
ext_cpuid[7]=00000000 0000001b 00000000 00006799
ext_cpuid[8]=00003030 010eb757 00007017 00010000
@ -67,13 +44,6 @@ ext_cpuid[26]=00000006 00000000 00000000 00000000
ext_cpuid[27]=000003ff 00000000 00000000 00000000
ext_cpuid[28]=00000000 00000000 00000000 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004121 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 01c0003f 0000003f 00000000
ext_cpuid[29]=00004122 01c0003f 0000003f 00000000
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00004143 01c0003f 000003ff 00000002
ext_cpuid[29]=00014163 03c0003f 00003fff 00000001
ext_cpuid[29]=00014163 03c0003f 00003fff 00000001
ext_cpuid[30]=00000000 00000100 00000000 00000000
ext_cpuid[31]=0001000f 0000016f 000001fd 00000001
--------------------------------------------------------------------------------
@ -91,7 +61,7 @@ ext_cpuid[31]=0001000f 0000016f 000001fd 00000001
-1
8
8
0
16
-1
64
64

View file

@ -6,15 +6,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#define LINE_LEN 53
#define FILENAME_LEN 32
#define FILENAME_LEN 128
#define CMD_LEN 256
#define EXT_CPUID 0x80000000
int main(int argc, char *argv[])
{
uint32_t addr, eax, ebx, ecx, edx;
uint32_t addr, prev_addr, eax, ebx, ecx, edx;
char line[LINE_LEN], raw_filename[FILENAME_LEN], report_filename[FILENAME_LEN], cmd[CMD_LEN];
FILE *fin = NULL, *fout = NULL;
@ -24,25 +25,29 @@ int main(int argc, char *argv[])
return 1;
}
snprintf(raw_filename, FILENAME_LEN, "%s.raw", argv[2]);
snprintf(report_filename, FILENAME_LEN, "%s_report.txt", argv[2]);
const char *input_filename = argv[1];
const char *output_filename = argv[2];
snprintf(raw_filename, FILENAME_LEN, "%s.raw", output_filename);
snprintf(report_filename, FILENAME_LEN, "%s_report.txt", output_filename);
if((fin = fopen(argv[1], "r")) == NULL)
/* Open files */
if((fin = fopen(input_filename, "r")) == NULL)
{
perror("Failed to open input file");
return 1;
}
if((fout = fopen(raw_filename, "w")) == NULL)
{
perror("Failed to open output file");
return 1;
}
/* Parse and convert CPUID dump */
prev_addr = -1;
while(fgets(line, LINE_LEN, fin) != NULL)
{
sscanf(line, "CPUID %x: %x-%x-%x-%x", &addr, &eax, &ebx, &ecx, &edx);
if(((addr < EXT_CPUID) && (addr >= 32)) || ((addr >= EXT_CPUID) && (addr - EXT_CPUID >= 32)))
if(((addr < EXT_CPUID) && (addr >= 32)) || ((addr >= EXT_CPUID) && (addr - EXT_CPUID >= 32)) || (addr == prev_addr))
continue;
if(addr < EXT_CPUID)
@ -50,13 +55,27 @@ int main(int argc, char *argv[])
else
fprintf(fout, "ext_cpuid[%d]", addr - EXT_CPUID);
fprintf(fout, "=%08x %08x %08x %08x\n", eax, ebx, ecx, edx);
prev_addr = addr;
}
/* Invoke cpuid_tool */
fclose(fout);
snprintf(cmd, CMD_LEN, "cpuid_tool --load=%s --report --outfile=%s", raw_filename, report_filename);
system(cmd);
printf("Done. Use the following command to create the test file:\n");
printf("./create_test.py %s %s > %s.test\n", raw_filename, report_filename, argv[2]);
/* Invoke create_test */
snprintf(cmd, CMD_LEN, "./create_test.py %s %s > %s.test", raw_filename, report_filename, output_filename);
if((argc > 3) && !strcmp(argv[3], "--create"))
{
system(cmd);
remove(raw_filename);
remove(report_filename);
}
else
{
printf("Done. Use the following command to create the test file:\n");
printf("%s\n", cmd);
}
return 0;
}