[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 29/33] pc: Use compat_props for CPUID compat bits
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH v4 29/33] pc: Use compat_props for CPUID compat bits |
Date: |
Thu, 14 Aug 2014 16:25:58 -0300 |
x86_cpu_compat_set_features() is not necessary anymore, as now we can
simply use compat_props.
Signed-off-by: Eduardo Habkost <address@hidden>
---
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
- [Qemu-devel] [PATCH v4 23/33] pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass, (continued)
- [Qemu-devel] [PATCH v4 23/33] pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass, Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 24/33] pc: Add PCMachineClass.compat_apic_id_mode field, Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 25/33] target-i386: Move error handling to end of x86_cpu_parse_featurestr(), Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 26/33] target-i386: Renove underscores from feature names, Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 27/33] target-i386: Register X86CPU "feat-kvmclock" feature, Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 28/33] target-i386: set [+-]feature using QOM properties, Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 29/33] pc: Use compat_props for CPUID compat bits,
Eduardo Habkost <=
- [Qemu-devel] [PATCH v4 30/33] target-i386: Move some declarations to hw/i386/cpu.h, Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 31/33] pc: Add default KVM features fields to PCMachineClass, Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 32/33] pc: Eliminate pc_compat_*() functions, Eduardo Habkost, 2014/08/14
- [Qemu-devel] [PATCH v4 33/33] piix: Move pc_xen_hvm_init() closer to xenfv_machine_class_init(), Eduardo Habkost, 2014/08/14