From patchwork Fri Jun 24 07:10:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 9196811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A02DD6075F for ; Fri, 24 Jun 2016 07:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E35128482 for ; Fri, 24 Jun 2016 07:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82C8728499; Fri, 24 Jun 2016 07:12:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 2D42228482 for ; Fri, 24 Jun 2016 07:12:06 +0000 (UTC) Received: from localhost ([::1]:41506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGLHZ-0007T1-B1 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 24 Jun 2016 03:12:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGLG9-0006rq-Hb for qemu-devel@nongnu.org; Fri, 24 Jun 2016 03:10:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGLG3-0008Tp-81 for qemu-devel@nongnu.org; Fri, 24 Jun 2016 03:10:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGLG3-0008Th-2k for qemu-devel@nongnu.org; Fri, 24 Jun 2016 03:10:31 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 402D07AE8E; Fri, 24 Jun 2016 07:10:30 +0000 (UTC) Received: from pxdev.xzpeter.org.com (dhcp-15-92.nay.redhat.com [10.66.15.92]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5O7AQoR023696; Fri, 24 Jun 2016 03:10:26 -0400 From: Peter Xu To: qemu-devel@nongnu.org Date: Fri, 24 Jun 2016 15:10:21 +0800 Message-Id: <1466752221-22588-1-git-send-email-peterx@redhat.com> In-Reply-To: <1466495274-5011-2-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 24 Jun 2016 07:10:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v10 27/26] intel_iommu: disallow kernel-irqchip=on with IR X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, jasowang@redhat.com, rkrcmar@redhat.com, peterx@redhat.com, alex.williamson@redhat.com, jan.kiszka@web.de, wexu@redhat.com, pbonzini@redhat.com, marcel@redhat.com, imammedo@redhat.com, davidkiarie4@gmail.com, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP When user specify "kernel-irqchip=on", throw error and then quit. Signed-off-by: Peter Xu --- One more patch for this series. Without this one, guest kernel will possibly hang. This is not user friendly. hw/i386/intel_iommu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 4ff9a24..618b0f9 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -20,6 +20,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/sysbus.h" #include "exec/address-spaces.h" #include "intel_iommu_internal.h" @@ -29,6 +30,7 @@ #include "hw/boards.h" #include "hw/i386/x86-iommu.h" #include "hw/pci-host/q35.h" +#include "sysemu/kvm.h" /*#define DEBUG_INTEL_IOMMU*/ #ifdef DEBUG_INTEL_IOMMU @@ -2458,6 +2460,13 @@ static void vtd_realize(DeviceState *dev, Error **errp) bus->iommu_opaque = dev; /* Pseudo address space under root PCI bus. */ pcms->ioapic_as = vtd_host_dma_iommu(bus, s, Q35_PSEUDO_DEVFN_IOAPIC); + + /* Currently Intel IOMMU IR only support "kernel-irqchip={off|split}" */ + if (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) { + error_report("Intel Interrupt Remapping cannot work with " + "kernel-irqchip=on, please use 'split|off'."); + exit(1); + } } static void vtd_class_init(ObjectClass *klass, void *data)