x86_cpu_compat_set_features() is not necessary anymore, as now we can simply use compat_props.
Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- hw/i386/pc_piix.c | 2 -- hw/i386/pc_q35.c | 2 -- include/hw/i386/pc.h | 8 ++++++++ target-i386/cpu.c | 26 -------------------------- target-i386/cpu.h | 3 --- 5 files changed, 8 insertions(+), 33 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 0d13919..988583c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -314,8 +314,6 @@ static void pc_compat_1_5(MachineState *machine) static void pc_compat_1_4(MachineState *machine) { pc_compat_1_5(machine); - x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE); - x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ); } static void pc_compat_1_3(MachineState *machine) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 0a637cb..2ebd598 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -287,8 +287,6 @@ static void pc_compat_1_5(MachineState *machine) static void pc_compat_1_4(MachineState *machine) { pc_compat_1_5(machine); - x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE); - x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ); } static void pc_q35_init_2_0(MachineState *machine) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index b460530..460ff21 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -513,6 +513,14 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "486-" TYPE_X86_CPU,\ .property = "model",\ .value = stringify(0),\ + },{\ + .driver = "n270-" TYPE_X86_CPU,\ + .property = "feat-movbe",\ + .value = "off",\ + },{\ + .driver = "Westmere-" TYPE_X86_CPU,\ + .property = "feat-pclmulqdq",\ + .value = "off",\ } #endif diff --git a/target-i386/cpu.c b/target-i386/cpu.c index e058c1a..e86f99e 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1149,32 +1149,6 @@ static X86CPUDefinition builtin_x86_defs[] = { }, }; -/** - * x86_cpu_compat_set_features: - * @cpu_model: CPU model name to be changed. If NULL, all CPU models are changed - * @w: Identifies the feature word to be changed. - * @feat_add: Feature bits to be added to feature word - * @feat_remove: Feature bits to be removed from feature word - * - * Change CPU model feature bits for compatibility. - * - * This function may be used by machine-type compatibility functions - * to enable or disable feature bits on specific CPU models. - */ -void x86_cpu_compat_set_features(const char *cpu_model, FeatureWord w, - uint32_t feat_add, uint32_t feat_remove) -{ - X86CPUDefinition *def; - int i; - for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); i++) { - def = &builtin_x86_defs[i]; - if (!cpu_model || !strcmp(cpu_model, def->name)) { - def->features[w] |= feat_add; - def->features[w] &= ~feat_remove; - } - } -} - #ifdef CONFIG_KVM static int cpu_x86_fill_model_id(char *str) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index e634d83..7ff2a3f 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -1297,9 +1297,6 @@ void do_smm_enter(X86CPU *cpu); void cpu_report_tpr_access(CPUX86State *env, TPRAccess access); -void x86_cpu_compat_set_features(const char *cpu_model, FeatureWord w, - uint32_t feat_add, uint32_t feat_remove); - void x86_cpu_compat_disable_kvm_features(FeatureWord w, uint32_t features); -- 1.9.3