Skip to content

Commit 2beaa82

Browse files
authored
Merge pull request #2283 from martin-frbg/issue2176
Support QEMU virtual cpu in 64bit mode as CORE2 or BARCELONA
2 parents 5f6206f + e8a2aed commit 2beaa82

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

cpuid_x86.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,8 +1379,6 @@ int get_cpuname(void){
13791379
break;
13801380
case 7: // family 6 exmodel 7
13811381
switch (model) {
1382-
case 10: // Goldmont Plus
1383-
return CPUTYPE_NEHALEM;
13841382
case 14: // Ice Lake
13851383
if(support_avx512())
13861384
return CPUTYPE_SKYLAKEX;
@@ -1427,7 +1425,11 @@ int get_cpuname(void){
14271425
case 0x5:
14281426
return CPUTYPE_AMDK6;
14291427
case 0x6:
1428+
#if defined(__x86_64__) || defined(__amd64__)
1429+
return CPUTYPE_BARCELONA;
1430+
#else
14301431
return CPUTYPE_ATHLON;
1432+
#endif
14311433
case 0xf:
14321434
switch (exfamily) {
14331435
case 0:
@@ -1810,7 +1812,11 @@ int get_coretype(void){
18101812
case 4:
18111813
case 5:
18121814
case 6:
1815+
#if defined(__x86_64__) || defined(__amd64__)
1816+
return CORE_CORE2;
1817+
#else
18131818
return CORE_P6;
1819+
#endif
18141820
case 7:
18151821
return CORE_KATMAI;
18161822
case 8:
@@ -2017,7 +2023,11 @@ int get_coretype(void){
20172023

20182024
if (vendor == VENDOR_AMD){
20192025
if (family <= 0x5) return CORE_80486;
2026+
#if defined(__x86_64__) || defined(__amd64__)
2027+
if (family <= 0xe) return CORE_BARCELONA;
2028+
#else
20202029
if (family <= 0xe) return CORE_ATHLON;
2030+
#endif
20212031
if (family == 0xf){
20222032
if ((exfamily == 0) || (exfamily == 2)) return CORE_OPTERON;
20232033
else if (exfamily == 5) return CORE_BOBCAT;

0 commit comments

Comments
 (0)