From patchwork Tue Nov 2 14:55:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 297562 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 oA2EtvB1021122 for ; Tue, 2 Nov 2010 14:55:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752872Ab0KBOzy (ORCPT ); Tue, 2 Nov 2010 10:55:54 -0400 Received: from goliath.siemens.de ([192.35.17.28]:19415 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423Ab0KBOzy (ORCPT ); Tue, 2 Nov 2010 10:55:54 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id oA2EtcEq020869; Tue, 2 Nov 2010 15:55:38 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id oA2EtbMe023061; Tue, 2 Nov 2010 15:55:38 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org Subject: [PATCH 2/4] pci-assign: Allow to disable MSI perference for host IRQ Date: Tue, 2 Nov 2010 15:55:35 +0100 Message-Id: <4835b561d28ba0314c52767a5246174fd1bf163e.1288709734.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.1 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Nov 2010 14:55:57 +0000 (UTC) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 349e864..73d8afd 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -964,7 +964,8 @@ static int assign_irq(AssignedDevice *dev) } assigned_irq_data.flags = KVM_DEV_IRQ_GUEST_INTX; - if (dev->cap.available & ASSIGNED_DEVICE_CAP_MSI) + if (dev->features & ASSIGNED_DEVICE_PREFER_MSI_MASK && + 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; @@ -1541,6 +1542,8 @@ static PCIDeviceInfo assign_info = { DEFINE_PROP_BIT("iommu", AssignedDevice, features, ASSIGNED_DEVICE_USE_IOMMU_BIT, true), DEFINE_PROP_STRING("configfd", AssignedDevice, configfd_name), + DEFINE_PROP_BIT("prefer_msi", AssignedDevice, features, + ASSIGNED_DEVICE_PREFER_MSI_BIT, true), DEFINE_PROP_END_OF_LIST(), }, }; diff --git a/hw/device-assignment.h b/hw/device-assignment.h index 4eb5835..56b7076 100644 --- a/hw/device-assignment.h +++ b/hw/device-assignment.h @@ -75,8 +75,10 @@ typedef struct { } AssignedDevRegion; #define ASSIGNED_DEVICE_USE_IOMMU_BIT 0 +#define ASSIGNED_DEVICE_PREFER_MSI_BIT 1 #define ASSIGNED_DEVICE_USE_IOMMU_MASK (1 << ASSIGNED_DEVICE_USE_IOMMU_BIT) +#define ASSIGNED_DEVICE_PREFER_MSI_MASK (1 << ASSIGNED_DEVICE_PREFER_MSI_BIT) typedef struct AssignedDevice { PCIDevice dev;