1
0
Fork 0
mirror of https://github.com/yuzu-emu/unicorn.git synced 2025-01-14 02:05:39 +00:00

target-i386: Disable VME by default with TCG

VME is already disabled automatically when using TCG. So, instead
of pretending it is there when reporting CPU model data on
query-cpu-* QMP commands (making every CPU model to be reported
as not runnable), we can disable it by default on all CPU models
when using TCG.

Do that by adding a tcg_default_props array that will work like
kvm_default_props.

Backports commit 04d99c3c61f4bdc0450dbeb6512b6dd743baca65 from qemu
This commit is contained in:
Eduardo Habkost 2018-02-26 08:22:48 -05:00 committed by Lioncash
parent 594cbeaa06
commit 6d1a7bccb5
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1773,6 +1773,17 @@ static X86CPUDefinition builtin_x86_defs[] = {
},
};
typedef struct PropValue {
const char *prop, *value;
} PropValue;
/* TCG-specific defaults that override all CPU models when using TCG
*/
static PropValue tcg_default_props[] = {
{ "vme", "off" },
{ NULL, NULL },
};
static uint32_t x86_cpu_get_supported_feature_word(struct uc_struct *uc,
FeatureWord w, bool migratable);
@ -2191,6 +2202,18 @@ static int x86_cpu_filter_features(X86CPU *cpu)
return rv;
}
static void x86_cpu_apply_props(X86CPU *cpu, PropValue *props)
{
PropValue *pv;
for (pv = props; pv->prop; pv++) {
if (!pv->value) {
continue;
}
object_property_parse(cpu->uc, OBJECT(cpu), pv->value, pv->prop,
&error_abort);
}
}
/* Load data from X86CPUDefinition
*/
static void x86_cpu_load_def(X86CPU *cpu, X86CPUDefinition *def, Error **errp)
@ -2210,6 +2233,10 @@ static void x86_cpu_load_def(X86CPU *cpu, X86CPUDefinition *def, Error **errp)
env->features[w] = def->features[w];
}
if (tcg_enabled(cpu->uc)) {
x86_cpu_apply_props(cpu, tcg_default_props);
}
env->features[FEAT_1_ECX] |= CPUID_EXT_HYPERVISOR;
/* sysenter isn't supported in compatibility mode on AMD,