From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJsLp-0003fS-4y for qemu-devel@nongnu.org; Thu, 04 Oct 2012 16:49:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJsL7-0003q2-U8 for qemu-devel@nongnu.org; Thu, 04 Oct 2012 16:48:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJsL7-0003pb-MJ for qemu-devel@nongnu.org; Thu, 04 Oct 2012 16:48:13 -0400 From: Eduardo Habkost Date: Thu, 4 Oct 2012 17:49:02 -0300 Message-Id: <1349383747-19383-11-git-send-email-ehabkost@redhat.com> In-Reply-To: <1349383747-19383-1-git-send-email-ehabkost@redhat.com> References: <1349383747-19383-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 10/15] i386: kvm: x2apic is not supported without in-kernel irqchip List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, Gleb Natapov , Marcelo Tosatti , Avi Kivity , Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= 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 --- target-i386/kvm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 704ad33..590f4d5 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: -- 1.7.11.4