From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQ6eF-0005Ks-8C for qemu-devel@nongnu.org; Mon, 14 Nov 2011 19:13:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQ6eE-0003DF-5L for qemu-devel@nongnu.org; Mon, 14 Nov 2011 19:13:11 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:40572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQ6eD-0003D2-G6 for qemu-devel@nongnu.org; Mon, 14 Nov 2011 19:13:10 -0500 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 15 Nov 2011 01:07:28 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAF09oHR2699440 for ; Tue, 15 Nov 2011 11:09:57 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAF0CtI0030833 for ; Tue, 15 Nov 2011 11:12:56 +1100 Date: Tue, 15 Nov 2011 11:00:50 +1100 From: David Gibson Message-ID: <20111115000050.GA4882@truffala.fritz.box> References: <20111103195452.21259.93021.stgit@bling.home> <20111111175118.GA6946@phenom.dumpdata.com> <1321049456.2682.220.camel@bling.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1321049456.2682.220.camel@bling.home> Subject: Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: aafabbri@cisco.com, aik@au1.ibm.com, kvm@vger.kernel.org, pmac@au1.ibm.com, joerg.roedel@amd.com, Konrad Rzeszutek Wilk , agraf@suse.de, qemu-devel@nongnu.org, chrisw@sous-sol.org, B08248@freescale.com, iommu@lists.linux-foundation.org, avi@redhat.com, linux-pci@vger.kernel.org, B07421@freescale.com, benve@cisco.com On Fri, Nov 11, 2011 at 03:10:56PM -0700, Alex Williamson wrote: > Thanks Konrad! Comments inline. > On Fri, 2011-11-11 at 12:51 -0500, Konrad Rzeszutek Wilk wrote: > > On Thu, Nov 03, 2011 at 02:12:24PM -0600, Alex Williamson wrote: [snip] > > > +The GET_NUM_REGIONS ioctl tells us how many regions the device supports: > > > + > > > +#define VFIO_DEVICE_GET_NUM_REGIONS _IOR(';', 109, int) > > > > Don't want __u32? > > It could be, not sure if it buys us anything maybe even restricts us. > We likely don't need 2^32 regions (famous last words?), so we could > later define <0 to something? As a rule, it's best to use explicit fixed width types for all ioctl() arguments, to avoid compat hell for 32-bit userland on 64-bit kernel setups. [snip] > > > +Again, zero count entries are allowed (vfio-pci uses a static interrupt > > > +type to index mapping). > > > > I am not really sure what that means. > > This is so PCI can expose: > > enum { > VFIO_PCI_INTX_IRQ_INDEX, > VFIO_PCI_MSI_IRQ_INDEX, > VFIO_PCI_MSIX_IRQ_INDEX, > VFIO_PCI_NUM_IRQS > }; > > So like regions it always exposes 3 IRQ indexes where count=0 if the > device doesn't actually support that type of interrupt. I just want to > spell out that bus drivers have this kind of flexibility. I knew what you were aiming for, so I could see what you meant here, but I don't think the doco is very clearly expressed at all. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson