]> Git Repo - qemu.git/commitdiff
target-i386: Enable x2apic by default on KVM
authorEduardo Habkost <[email protected]>
Wed, 19 Feb 2014 14:58:12 +0000 (11:58 -0300)
committerAndreas Färber <[email protected]>
Thu, 13 Mar 2014 18:01:49 +0000 (19:01 +0100)
When on KVM mode, enable x2apic by default on all CPU models.

Normally we try to keep the CPU model definitions as close as the real
CPUs as possible, but x2apic can be emulated by KVM without host CPU
support for x2apic, and it improves performance by reducing APIC access
overhead. x2apic emulation is available on KVM since 2009 (Linux
2.6.32-rc1), there's no reason for not enabling x2apic by default when
running KVM.

Signed-off-by: Eduardo Habkost <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Andreas Färber <[email protected]>
hw/i386/pc_piix.c
hw/i386/pc_q35.c
target-i386/cpu.c

index 5011c3af6a05f8e3bdf576746a58df67798bb69a..7930a26c1e03bebf0c9b76129273c2fdbe3ddca3 100644 (file)
@@ -267,6 +267,7 @@ static void pc_compat_1_7(QEMUMachineInitArgs *args)
     smbios_type1_defaults = false;
     gigabyte_align = false;
     option_rom_has_mr = true;
+    x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
 }
 
 static void pc_compat_1_6(QEMUMachineInitArgs *args)
index 4b0456a95bbbe0bfc93d123709e3f02cee36941a..c844dc2a9fe840e271c9434c7a73b62fd0d96227 100644 (file)
@@ -245,6 +245,7 @@ static void pc_compat_1_7(QEMUMachineInitArgs *args)
     smbios_type1_defaults = false;
     gigabyte_align = false;
     option_rom_has_mr = true;
+    x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
 }
 
 static void pc_compat_1_6(QEMUMachineInitArgs *args)
index 5f960acad8e58f5cbd2ebe487d73cc82b1ab2a87..ea2033215f0fc4bd820acc4a55707640043ec8a7 100644 (file)
@@ -369,6 +369,7 @@ static uint32_t kvm_default_features[FEATURE_WORDS] = {
         (1 << KVM_FEATURE_STEAL_TIME) |
         (1 << KVM_FEATURE_PV_EOI) |
         (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT),
+    [FEAT_1_ECX] = CPUID_EXT_X2APIC,
 };
 
 void x86_cpu_compat_disable_kvm_features(FeatureWord w, uint32_t features)
This page took 0.034825 seconds and 4 git commands to generate.