From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NxIBC-0004LZ-5t for qemu-devel@nongnu.org; Thu, 01 Apr 2010 07:03:18 -0400 Received: from [140.186.70.92] (port=55959 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NxIBA-0004LR-GV for qemu-devel@nongnu.org; Thu, 01 Apr 2010 07:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NxIB8-0002Oq-RN for qemu-devel@nongnu.org; Thu, 01 Apr 2010 07:03:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7864) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NxIB8-0002Ob-Iu for qemu-devel@nongnu.org; Thu, 01 Apr 2010 07:03:14 -0400 Date: Thu, 1 Apr 2010 13:59:29 +0300 From: "Michael S. Tsirkin" Message-ID: <20100401105929.GC3323@redhat.com> References: <1269497376-21903-1-git-send-email-cam@cs.ualberta.ca> <4BAB30EE.4020509@redhat.com> <8286e4ee1003250924q7cca5e71u8b8b7c6d8b785eb8@mail.gmail.com> <4BAB90BB.5030401@redhat.com> <8286e4ee1003260914u5e6ceee2pf0c00590de182fb6@mail.gmail.com> <4BAE44F2.20801@redhat.com> <8286e4ee1003281248k204a5bd4tc48e6ccc755918b@mail.gmail.com> <4BB114AC.9040902@redhat.com> <20100331091250.GA31085@redhat.com> <4BB46035.70701@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BB46035.70701@redhat.com> Subject: [Qemu-devel] Re: [PATCH v3 1/1] Shared memory uio_pci driver List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Cam Macdonell , qemu-devel@nongnu.org, kvm@vger.kernel.org On Thu, Apr 01, 2010 at 11:58:29AM +0300, Avi Kivity wrote: > On 03/31/2010 12:12 PM, Michael S. Tsirkin wrote: >> >> >>> $ echo 4> /sys/.../msix/allocate >>> $ # subdirectories 0 1 2 3 magically appear >>> $ # bind fd 13 to msix >>> >> There's no way to know, when qemu starts, how many vectors will be used >> by driver. So I think we can just go ahead and allocate as many vectors >> as supported by device at the moment when the first eventfd is bound. >> > > That will cause a huge amount of vectors to be allocated. It's better > to do this dynamically in response to guest programming. guest unmasks vectors one by one. Linux does not have an API to allocate vectors one by one now. >>> $ echo 13> /sys/.../msix/2/bind-fd >>> >> I think that this one can't work, both fd 13 and sysfs file will get >> closed when /bin/echo process exits. >> > > I meant figuratively. It's pointless to bind an eventfd from a shell. > You'd use fprintf() from qemu to bind the eventfd. > >>> $ # from now on, msix interrupt 2 will call eventfd_signal() on fd 13 >>> >>> Call me old fashioned, but I prefer ioctls. >>> >> I think we will have to use ioctl or irqcontrol because of lifetime >> issues outlines above. >> > > The lifetime issues don't exist if you do all that from qemu. That's > not to say I prefer sysfs to ioctl. > > What's irqcontrol? uio core accepts 32 bit writes and passes the value written as int to an irqcontrol callback in the device. > -- > error compiling committee.c: too many arguments to function