From patchwork Tue Mar 17 03:50:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 12548 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2H3pZdQ014488 for ; Tue, 17 Mar 2009 03:51:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761268AbZCQDvB (ORCPT ); Mon, 16 Mar 2009 23:51:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762773AbZCQDvA (ORCPT ); Mon, 16 Mar 2009 23:51:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:20459 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762545AbZCQDuZ (ORCPT ); Mon, 16 Mar 2009 23:50:25 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 16 Mar 2009 20:42:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,375,1233561600"; d="scan'208";a="673489741" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.189]) by fmsmga001.fm.intel.com with ESMTP; 16 Mar 2009 20:54:06 -0700 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1LjQJm-0007Ht-7W; Tue, 17 Mar 2009 11:50:18 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti , Anthony Liguori Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 14/16] kvm: fix interrupt pin 0 assignment Date: Tue, 17 Mar 2009 11:50:15 +0800 Message-Id: <1237261817-27955-15-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1237261817-27955-1-git-send-email-sheng@linux.intel.com> References: <1237261817-27955-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Shouldn't update assigned irq if assigned device's interrupt pin is 0, which means uninitialized or don't support INTx. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index b0b90c1..411ccc5 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device-assignment.c @@ -590,6 +590,10 @@ static int assign_irq(AssignedDevInfo *adev) AssignedDevice *dev = adev->assigned_dev; int irq, r = 0; + /* Interrupt PIN 0 means don't use INTx */ + if (pci_read_byte(dev->pdev, PCI_INTERRUPT_PIN) == 0) + return 0; + irq = pci_map_irq(&dev->dev, dev->intpin); irq = piix_get_irq(irq);