From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v3 1/1] Shared memory uio_pci driver Date: Thu, 01 Apr 2010 14:27:02 +0300 Message-ID: <4BB48306.7020604@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> <20100401105929.GC3323@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Cam Macdonell , kvm@vger.kernel.org, qemu-devel@nongnu.org To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40192 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754258Ab0DAL1G (ORCPT ); Thu, 1 Apr 2010 07:27:06 -0400 In-Reply-To: <20100401105929.GC3323@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/01/2010 01:59 PM, Michael S. Tsirkin wrote: > 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. > Well, maybe it should. I'm worried that the guest could exhaust host irqs if we allocate the maximum amount. >> What's irqcontrol? >> > uio core accepts 32 bit writes and passes the value written > as int to an irqcontrol callback in the device. > I see. In this case I withdraw my earlier objection about using write() to control eventfd binding, as it's clearly interrupt related. I still prefer an explicit ioctl though. I think you suggested to allow irqcontrol to support >4 byte writes, that should also work. -- error compiling committee.c: too many arguments to function