From patchwork Wed Nov 3 20:17:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 300422 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA3KI8YO029865 for ; Wed, 3 Nov 2010 20:18:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755442Ab0KCURi (ORCPT ); Wed, 3 Nov 2010 16:17:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12109 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754825Ab0KCURh (ORCPT ); Wed, 3 Nov 2010 16:17:37 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA3KHagQ023337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Nov 2010 16:17:36 -0400 Received: from s20.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oA3KHXQv010029; Wed, 3 Nov 2010 16:17:34 -0400 From: Alex Williamson Subject: [PATCH] vfio: Fix PCI 2.3 shared interrupt To: pugs@cisco.com Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, alex.williamson@redhat.com Date: Wed, 03 Nov 2010 14:17:33 -0600 Message-ID: <20101103201732.7400.28058.stgit@s20.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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.3 (demeter1.kernel.org [140.211.167.41]); Wed, 03 Nov 2010 20:18:09 +0000 (UTC) diff --git a/drivers/vfio/vfio_intrs.c b/drivers/vfio/vfio_intrs.c index 604082c..73e3deb 100644 --- a/drivers/vfio/vfio_intrs.c +++ b/drivers/vfio/vfio_intrs.c @@ -57,6 +57,12 @@ irqreturn_t vfio_interrupt(int irq, void *dev_id) spin_lock_irq(&vdev->irqlock); + /* INTX disabled interrupts can still be shared */ + if (vdev->irq_disabled) { + spin_unlock_irq(&vdev->irqlock); + return ret; + } + if (vdev->pci_2_3) { pci_block_user_cfg_access(pdev); @@ -87,7 +93,8 @@ done: ret = IRQ_HANDLED; } - vdev->irq_disabled = (ret == IRQ_HANDLED); + if (ret == IRQ_HANDLED) + vdev->irq_disabled = true; spin_unlock_irq(&vdev->irqlock);