From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH 5/4] pci-assign: Use PCI-2.3-based shared legacy interrupts by default Date: Wed, 3 Nov 2010 11:11:38 +0200 Message-ID: <20101103091138.GI6772@redhat.com> References: <4CD119D6.2050602@web.de> <20101103083321.GE6772@redhat.com> <4CD120E9.7050306@web.de> 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]:57952 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753685Ab0KCJLj (ORCPT ); Wed, 3 Nov 2010 05:11:39 -0400 Content-Disposition: inline In-Reply-To: <4CD120E9.7050306@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 03, 2010 at 09:44:25AM +0100, Jan Kiszka wrote: > Am 03.11.2010 09:33, Michael S. Tsirkin wrote: > > On Wed, Nov 03, 2010 at 09:14:14AM +0100, Jan Kiszka wrote: > >> From: Jan Kiszka > >> > >> Make use of the new KVM feature that allows legacy interrupt sharing > >> for PCI-2.3-compliant devices. Exclusive mode (with IRQ masking at > >> interrupt controller level) can be re-enabled via disabling the > >> property "pci_2_3". > >> > >> Signed-off-by: Jan Kiszka > >> --- > >> hw/device-assignment.c | 7 +++++++ > >> hw/device-assignment.h | 2 ++ > >> 2 files changed, 9 insertions(+), 0 deletions(-) > >> > >> diff --git a/hw/device-assignment.c b/hw/device-assignment.c > >> index 0bbf9d9..5c7e958 100644 > >> --- a/hw/device-assignment.c > >> +++ b/hw/device-assignment.c > >> @@ -970,6 +970,11 @@ static int assign_irq(AssignedDevice *dev) > >> } > >> > >> assigned_irq_data.flags = KVM_DEV_IRQ_GUEST_INTX; > >> +#ifdef KVM_CAP_PCI_2_3 > >> + if (dev->features & ASSIGNED_DEVICE_USE_PCI_2_3_MASK) { > >> + assigned_irq_data.flags |= KVM_DEV_IRQ_PCI_2_3; > >> + } > >> +#endif /* KVM_CAP_PCI_2_3 */ > >> if (dev->features & ASSIGNED_DEVICE_PREFER_MSI_MASK && > >> dev->cap.available & ASSIGNED_DEVICE_CAP_MSI) > >> assigned_irq_data.flags |= KVM_DEV_IRQ_HOST_MSI; > >> @@ -1550,6 +1555,8 @@ static PCIDeviceInfo assign_info = { > >> DEFINE_PROP_STRING("configfd", AssignedDevice, configfd_name), > >> DEFINE_PROP_BIT("prefer_msi", AssignedDevice, features, > >> ASSIGNED_DEVICE_PREFER_MSI_BIT, true), > >> + DEFINE_PROP_BIT("pci_2_3", AssignedDevice, features, > >> + ASSIGNED_DEVICE_USE_PCI_2_3_BIT, true), > > > > I'd prefer some other name that hints this is a kvm feature. > > Reason is, we might want to have pci_2_3 to mean that > > INTx is supported *on the guest side*. > > I did not get that use case yet, but I could call it "host_pci_2_3" if > preferred. Or provide a better name. > > Jan > Sounds good. -- MST