From patchwork Fri Mar 11 18:47:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 8568721 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D8B74C0553 for ; Fri, 11 Mar 2016 19:13:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31E3B2026F for ; Fri, 11 Mar 2016 19:13:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8FE142026D for ; Fri, 11 Mar 2016 19:13:57 +0000 (UTC) Received: from localhost ([::1]:57189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeS83-00046B-6J for patchwork-qemu-devel@patchwork.kernel.org; Fri, 11 Mar 2016 13:49:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeS6Z-000209-4L for qemu-devel@nongnu.org; Fri, 11 Mar 2016 13:48:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeS6Y-0002sx-1y for qemu-devel@nongnu.org; Fri, 11 Mar 2016 13:48:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeS6X-0002sn-Sq for qemu-devel@nongnu.org; Fri, 11 Mar 2016 13:48:05 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 779BF445AF; Fri, 11 Mar 2016 18:48:05 +0000 (UTC) Received: from localhost (vpn1-4-76.gru2.redhat.com [10.97.4.76]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2BIm4GJ018372; Fri, 11 Mar 2016 13:48:04 -0500 From: Eduardo Habkost To: Peter Maydell Date: Fri, 11 Mar 2016 15:47:54 -0300 Message-Id: <1457722074-25406-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1457722074-25406-1-git-send-email-ehabkost@redhat.com> References: <1457722074-25406-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, Paolo Bonzini , Lan Tianyu , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [Qemu-devel] [PULL 2/2] kvm: Remove x2apic feature from CPU model when kernel_irqchip is off X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lan Tianyu x2apic feature is in the kvm_default_props and automatically added to all CPU models when KVM is enabled. But userspace devices don't support x2apic which can't be enabled without the in-kernel irqchip. It will trigger warning of "host doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]" when kernel_irqchip is off. This patch is to fix it via removing x2apic feature when kernel_irqchip is off. Signed-off-by: Lan Tianyu Acked-by: Paolo Bonzini Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 0f38d1e..3ea6b29 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2132,6 +2132,10 @@ static void x86_cpu_load_def(X86CPU *cpu, X86CPUDefinition *def, Error **errp) /* Special cases not set in the X86CPUDefinition structs: */ if (kvm_enabled()) { + if (!kvm_irqchip_in_kernel()) { + x86_cpu_change_kvm_default("x2apic", "off"); + } + x86_cpu_apply_props(cpu, kvm_default_props); }