]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target-i386: Introduce x86_cpu_compat_disable_kvm_features()
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 19 Feb 2014 14:58:11 +0000 (11:58 -0300)
committerAndreas Färber <afaerber@suse.de>
Thu, 13 Mar 2014 18:01:49 +0000 (19:01 +0100)
Instead of the feature-specific disable_kvm_pv_eoi() function, create a
more general function that can be used to disable other feature bits in
machine-type compat code.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/i386/pc_piix.c
target-i386/cpu.c
target-i386/cpu.h

index 5e1d2d3de3b342d1bfaf34013c2a814003cbe285..5011c3af6a05f8e3bdf576746a58df67798bb69a 100644 (file)
@@ -299,7 +299,7 @@ static void pc_compat_1_3(QEMUMachineInitArgs *args)
 static void pc_compat_1_2(QEMUMachineInitArgs *args)
 {
     pc_compat_1_3(args);
-    disable_kvm_pv_eoi();
+    x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
 }
 
 static void pc_init_pci_1_7(QEMUMachineInitArgs *args)
@@ -345,7 +345,7 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
     has_pci_info = false;
     has_acpi_build = false;
     smbios_type1_defaults = false;
-    disable_kvm_pv_eoi();
+    x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
     enable_compat_apic_id_mode();
     pc_init1(args, 1, 0);
 }
@@ -358,7 +358,7 @@ static void pc_init_isa(QEMUMachineInitArgs *args)
     if (!args->cpu_model) {
         args->cpu_model = "486";
     }
-    disable_kvm_pv_eoi();
+    x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
     enable_compat_apic_id_mode();
     pc_init1(args, 0, 1);
 }
index 17fe45e84e3a5544b74c2cc123d799b98825169f..5f960acad8e58f5cbd2ebe487d73cc82b1ab2a87 100644 (file)
@@ -371,9 +371,9 @@ static uint32_t kvm_default_features[FEATURE_WORDS] = {
         (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT),
 };
 
-void disable_kvm_pv_eoi(void)
+void x86_cpu_compat_disable_kvm_features(FeatureWord w, uint32_t features)
 {
-    kvm_default_features[FEAT_KVM] &= ~(1UL << KVM_FEATURE_PV_EOI);
+    kvm_default_features[w] &= ~features;
 }
 
 void host_cpuid(uint32_t function, uint32_t count,
index 4b8c85b942a91d3c67860ff4c1add2be4ed659f9..2403321fa118867ea33d8ce1815f039823c205e6 100644 (file)
@@ -1262,11 +1262,11 @@ void do_smm_enter(X86CPU *cpu);
 
 void cpu_report_tpr_access(CPUX86State *env, TPRAccess access);
 
-void disable_kvm_pv_eoi(void);
-
 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);
+
 
 /* Return name of 32-bit register, from a R_* constant */
 const char *get_register_name_32(unsigned int reg);