From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] pci-assign: Fix MSI-X registration Date: Mon, 10 Oct 2011 15:55:51 +0200 Message-ID: <4E92F967.3070601@redhat.com> References: <20110922030909.4121.66872.stgit@s20.home> <20110922031242.4121.35090.stgit@s20.home> <4E7AFA02.5010409@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Alex Williamson , "kvm@vger.kernel.org" , "yongjie.ren@intel.com" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:62332 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753163Ab1JJNzz (ORCPT ); Mon, 10 Oct 2011 09:55:55 -0400 In-Reply-To: <4E7AFA02.5010409@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/22/2011 12:04 PM, Jan Kiszka wrote: > > goto out; > > > > + if (!kvm_check_extension(kvm_state, KVM_CAP_ASSIGN_DEV_IRQ)&& > > + (dev->cap.available& ASSIGNED_DEVICE_CAP_MSIX || > > + dev->cap.available& ASSIGNED_DEVICE_CAP_MSI || > > + assigned_dev_pci_read_byte(pci_dev, PCI_INTERRUPT_PIN) != 0)) { > > + goto out; > > + } > > + > > That's not equivalent as it needlessly prevents IRQ support in the > absence of KVM_CAP_ASSIGN_DEV_IRQ. > > Let's just fix the core issue and replace the test for > KVM_CAP_DEVICE_MSIX with a test call of KVM_ASSIGN_SET_MSIX_NR, passing > in a NULL struct. If it returns -EFAULT, the IOCTL is known and MSIX is > supported. > Or just add KVM_CAP_DEVICE_MSIX to the kernel and backport it where needed? -- error compiling committee.c: too many arguments to function