From patchwork Tue Mar 17 03:50:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 12545 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 n2H3pZdN014488 for ; Tue, 17 Mar 2009 03:51:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762703AbZCQDux (ORCPT ); Mon, 16 Mar 2009 23:50:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760544AbZCQDuv (ORCPT ); Mon, 16 Mar 2009 23:50:51 -0400 Received: from mga14.intel.com ([143.182.124.37]:16965 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762713AbZCQDu0 (ORCPT ); Mon, 16 Mar 2009 23:50:26 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 16 Mar 2009 20:50:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,375,1233561600"; d="scan'208";a="120955537" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.189]) by azsmga001.ch.intel.com with ESMTP; 16 Mar 2009 20:50:20 -0700 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1LjQJm-0007Hi-35; 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 10/16] kvm: Support MSI convert to INTx in device assignment Date: Tue, 17 Mar 2009 11:50:11 +0800 Message-Id: <1237261817-27955-11-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 Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index 9a3104b..d404286 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device-assignment.c @@ -595,7 +595,12 @@ static int assign_irq(AssignedDevInfo *adev) if (r && r != -ENXIO) perror("assign_irq: deassign"); } - assigned_irq_data.flags = KVM_DEV_IRQ_HOST_INTX | KVM_DEV_IRQ_GUEST_INTX; + + assigned_irq_data.flags = KVM_DEV_IRQ_GUEST_INTX; + if (dev->cap.available & ASSIGNED_DEVICE_CAP_MSI) + assigned_irq_data.flags |= KVM_DEV_IRQ_HOST_MSI; + else + assigned_irq_data.flags |= KVM_DEV_IRQ_HOST_INTX; #endif r = kvm_assign_irq(kvm_context, &assigned_irq_data);