From patchwork Thu Jul 21 18:14:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 996422 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6LIEnU1017291 for ; Thu, 21 Jul 2011 18:14:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753108Ab1GUSOq (ORCPT ); Thu, 21 Jul 2011 14:14:46 -0400 Received: from thoth.sbs.de ([192.35.17.2]:22529 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479Ab1GUSOq (ORCPT ); Thu, 21 Jul 2011 14:14:46 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id p6LIEg0H020285; Thu, 21 Jul 2011 20:14:42 +0200 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p6LIEfsx006280; Thu, 21 Jul 2011 20:14:42 +0200 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" , Alex Williamson Subject: [PATCH v2 2/7] pci-assign: Update legacy interrupts only if used Date: Thu, 21 Jul 2011 20:14:36 +0200 Message-Id: <8bb600a3547129b424e86f4047bc70dfbb61b061.1311272078.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 21 Jul 2011 18:14:49 +0000 (UTC) Don't mess with assign_intx on devices that are in MSI or MSI-X mode, it would corrupt their interrupt routing. Signed-off-by: Jan Kiszka --- hw/device-assignment.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 36c0f5f..a88d4fc 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -1062,9 +1062,12 @@ void assigned_dev_update_irqs(void) dev = QLIST_FIRST(&devs); while (dev) { next = QLIST_NEXT(dev, next); - r = assign_irq(dev); - if (r < 0) - qdev_unplug(&dev->dev.qdev); + if (dev->irq_requested_type & KVM_DEV_IRQ_HOST_INTX) { + r = assign_irq(dev); + if (r < 0) { + qdev_unplug(&dev->dev.qdev); + } + } dev = next; } }