From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzDpz-0001zM-Bc for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:26:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzDpy-0007rc-3g for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:26:11 -0400 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:19230 helo=TX2EHSOBE003.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzDpx-0007rR-Oc for qemu-devel@nongnu.org; Thu, 01 Sep 2011 16:26:10 -0400 Message-ID: <4E5FEA59.7070201@freescale.com> Date: Thu, 1 Sep 2011 15:26:01 -0500 From: Scott Wood MIME-Version: 1.0 References: <9F6FE96B71CF29479FF1CDC8046E15031B3313@039-SN1MPN1-002.039d.mgd.msft.net> <20110901200037.GP10989@redhat.com> In-Reply-To: <20110901200037.GP10989@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] RFC: vfio / device assignment -- layout of device fd files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Wood Scott-B07421 , "kvm@vger.kernel.org" , "Joerg.Roedel@amd.com" , "qemu-devel@nongnu.org" , Alexander Graf , Yoder Stuart-B08248 , "alex.williamson@redhat.com" , "avi@redhat.com" , David Gibson On 09/01/2011 03:00 PM, Michael S. Tsirkin wrote: > That's a very rich interface, and easy to get wrong. > AFAIK the only reason vfio uses read/write for PCI was to avoid inventing > a custom interface. But if you do, it looks like a set of ioctls would > be much easier? You can even fit the existing uio infrastructure if you like. How would it be easier than producing/parsing a static data structure? What would it look like? > Here's another idea: all the information is likely already available > in sysfs. The only major thing that is likely available elsewhere is PCI config space, and that was not new to this proposal. Most other material is specifically related to the vfio/dtio interface (e.g. offsets into the file handle, arguments to the "get irq fd" ioctl, mapping of dtio regions/interrupts to device tree nodes), and could not be "useful to more than just vfio". > A way to query where the device is in sysfs > would give you *a ton* of information, including the type etc, For PCI, the user has domain/bus/dev/fn which should be sufficient to find that, if desired. For device-tree devices, there's a device tree path provided for each region/interrupt. -Scott