aboutsummaryrefslogtreecommitdiff
path: root/target-i386/kvm.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2012-10-04 17:49:02 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2012-10-30 23:39:48 -0200
commit41e5e76db07b52591d9c9b88826278b8a5112258 (patch)
tree1047c4e96be3203fa5527e2238ff8f3c2eb4fdbd /target-i386/kvm.c
parentac67ee260ae8e353314b6995ed5dccf1bb94fa9d (diff)
i386: kvm: x2apic is not supported without in-kernel irqchip
This is necessary so that x2apic is not improperly enabled when the in-kernel irqchip is disabled. This won't generate a warning with "-cpu ...,check" because the current check/enforce code is broken (it checks the host CPU data directly, instead of using kvm_arch_get_supported_cpuid()), but it will be eventually fixed to properly report the missing x2apic flag. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r--target-i386/kvm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index aae8af22dd..4e96b046da 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -209,6 +209,13 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
kvm_check_extension(s, KVM_CAP_TSC_DEADLINE_TIMER)) {
ret |= CPUID_EXT_TSC_DEADLINE_TIMER;
}
+
+ /* x2apic is reported by GET_SUPPORTED_CPUID, but it can't be enabled
+ * without the in-kernel irqchip
+ */
+ if (!kvm_irqchip_in_kernel()) {
+ ret &= ~CPUID_EXT_X2APIC;
+ }
} else if (function == 0x80000001 && reg == R_EDX) {
/* On Intel, kvm returns cpuid according to the Intel spec,
* so add missing bits according to the AMD spec: