Revision 6d2edc43 target-i386/helper.c
b/target-i386/helper.c | ||
---|---|---|
44 | 44 |
"pni" /* Intel,AMD sse3 */, NULL, NULL, "monitor", "ds_cpl", "vmx", NULL /* Linux smx */, "est", |
45 | 45 |
"tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL, |
46 | 46 |
NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt", |
47 |
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
|
47 |
NULL, NULL, NULL, NULL, NULL, NULL, NULL, "hypervisor",
|
|
48 | 48 |
}; |
49 | 49 |
static const char *ext2_feature_name[] = { |
50 | 50 |
"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", |
... | ... | |
59 | 59 |
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
60 | 60 |
}; |
61 | 61 |
|
62 |
static void add_flagname_to_bitmaps(char *flagname, uint32_t *features,
|
|
63 |
uint32_t *ext_features,
|
|
64 |
uint32_t *ext2_features,
|
|
62 |
static void add_flagname_to_bitmaps(const char *flagname, uint32_t *features,
|
|
63 |
uint32_t *ext_features, |
|
64 |
uint32_t *ext2_features, |
|
65 | 65 |
uint32_t *ext3_features) |
66 | 66 |
{ |
67 | 67 |
int i; |
68 | 68 |
int found = 0; |
69 | 69 |
|
70 |
for ( i = 0 ; i < 32 ; i++ )
|
|
70 |
for ( i = 0 ; i < 32 ; i++ ) |
|
71 | 71 |
if (feature_name[i] && !strcmp (flagname, feature_name[i])) { |
72 | 72 |
*features |= 1 << i; |
73 | 73 |
found = 1; |
74 | 74 |
} |
75 |
for ( i = 0 ; i < 32 ; i++ )
|
|
75 |
for ( i = 0 ; i < 32 ; i++ ) |
|
76 | 76 |
if (ext_feature_name[i] && !strcmp (flagname, ext_feature_name[i])) { |
77 | 77 |
*ext_features |= 1 << i; |
78 | 78 |
found = 1; |
79 | 79 |
} |
80 |
for ( i = 0 ; i < 32 ; i++ )
|
|
80 |
for ( i = 0 ; i < 32 ; i++ ) |
|
81 | 81 |
if (ext2_feature_name[i] && !strcmp (flagname, ext2_feature_name[i])) { |
82 | 82 |
*ext2_features |= 1 << i; |
83 | 83 |
found = 1; |
84 | 84 |
} |
85 |
for ( i = 0 ; i < 32 ; i++ )
|
|
85 |
for ( i = 0 ; i < 32 ; i++ ) |
|
86 | 86 |
if (ext3_feature_name[i] && !strcmp (flagname, ext3_feature_name[i])) { |
87 | 87 |
*ext3_features |= 1 << i; |
88 | 88 |
found = 1; |
... | ... | |
330 | 330 |
goto error; |
331 | 331 |
memcpy(x86_cpu_def, def, sizeof(*def)); |
332 | 332 |
|
333 |
add_flagname_to_bitmaps("hypervisor", &plus_features, |
|
334 |
&plus_ext_features, &plus_ext2_features, &plus_ext3_features); |
|
335 |
|
|
333 | 336 |
featurestr = strtok(NULL, ","); |
334 | 337 |
|
335 | 338 |
while (featurestr) { |
... | ... | |
1523 | 1526 |
*ebx = (env->cpuid_apic_id << 24) | 8 << 8; /* CLFLUSH size in quad words, Linux wants it. */ |
1524 | 1527 |
*ecx = env->cpuid_ext_features; |
1525 | 1528 |
*edx = env->cpuid_features; |
1526 |
|
|
1527 |
/* "Hypervisor present" bit required for Microsoft SVVP */ |
|
1528 |
if (kvm_enabled()) |
|
1529 |
*ecx |= (1 << 31); |
|
1530 | 1529 |
break; |
1531 | 1530 |
case 2: |
1532 | 1531 |
/* cache info: needed for Pentium Pro compatibility */ |
Also available in: Unified diff