From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Armbruster Subject: Re: [PATCH 2/4] pci-assign: Allow to disable MSI perference for host IRQ Date: Wed, 03 Nov 2010 13:54:28 +0100 Message-ID: References: <4835b561d28ba0314c52767a5246174fd1bf163e.1288709734.git.jan.kiszka@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59879 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753006Ab0KCMyd (ORCPT ); Wed, 3 Nov 2010 08:54:33 -0400 In-Reply-To: <4835b561d28ba0314c52767a5246174fd1bf163e.1288709734.git.jan.kiszka@siemens.com> (Jan Kiszka's message of "Tue, 2 Nov 2010 15:55:35 +0100") Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka writes: > Some devices (e.g. the ath9k) claim to support MSI but actually do not > work when this is enabled. We must not blindly switch such devices to > MSI but rather provide the user a way to pass control back to the > guest driver. This can be done by turning the new property "prefer_msi" > off (default remains on). > > Signed-off-by: Jan Kiszka > --- > hw/device-assignment.c | 5 ++++- > hw/device-assignment.h | 2 ++ > 2 files changed, 6 insertions(+), 1 deletions(-) > > 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), Suggest to define the feature bit properties next to each other. > DEFINE_PROP_END_OF_LIST(), > }, > }; [...]