From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Np4Gk-00062H-2O for qemu-devel@nongnu.org; Tue, 09 Mar 2010 13:35:02 -0500 Received: from [199.232.76.173] (port=40250 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Np4Gj-00061Q-CJ for qemu-devel@nongnu.org; Tue, 09 Mar 2010 13:35:01 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Np4Gh-0006Sq-Vf for qemu-devel@nongnu.org; Tue, 09 Mar 2010 13:35:01 -0500 Received: from mail-iw0-f176.google.com ([209.85.223.176]:52610) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Np4Gh-0006Sg-MT for qemu-devel@nongnu.org; Tue, 09 Mar 2010 13:34:59 -0500 Received: by iwn6 with SMTP id 6so3890620iwn.4 for ; Tue, 09 Mar 2010 10:34:57 -0800 (PST) MIME-Version: 1.0 Sender: camm@ualberta.ca In-Reply-To: <4B968521.7000208@redhat.com> References: <1267833161-25267-1-git-send-email-cam@cs.ualberta.ca> <1267833161-25267-2-git-send-email-cam@cs.ualberta.ca> <4B94C9B3.1060904@redhat.com> <8286e4ee1003080957v9bb4837x187cebb8477348c2@mail.gmail.com> <4B962301.3030008@redhat.com> <8286e4ee1003090724m1ef0b571g8b705a24e36e1753@mail.gmail.com> <8286e4ee1003090727j1d45e5dq3bc5d2ae89c354c@mail.gmail.com> <4B968521.7000208@redhat.com> Date: Tue, 9 Mar 2010 11:34:56 -0700 Message-ID: <8286e4ee1003091034n236f1c07w6b121d76f138e706@mail.gmail.com> From: Cam Macdonell Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] Inter-VM shared memory PCI device List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On Tue, Mar 9, 2010 at 10:28 AM, Avi Kivity wrote: > On 03/09/2010 05:27 PM, Cam Macdonell wrote: >> >>> >>>> =A0Registers are used >>>> for synchronization between guests sharing the same memory object when >>>> interrupts are supported (this requires using the shared memory server= ). >>>> >>>> >>> >>> How does the driver detect whether interrupts are supported or not? >>> >> >> At the moment, the VM ID is set to -1 if interrupts aren't supported, >> but that may not be the clearest way to do things. =A0With UIO is there >> a way to detect if the interrupt pin is on? >> > > I suggest not designing the device to uio. =A0Make it a good guest-indepe= ndent > device, and if uio doesn't fit it, change it. > > Why not support interrupts unconditionally? =A0Is the device useful witho= ut > interrupts? Currently my patch works with or without the shared memory server. If you give the parameter -ivshmem 256,foo then this will create (if necessary) and map /dev/shm/foo as the shared region without interrupt support. Some users of shared memory are using it this way. Going forward we can require the shared memory server and always have interrupts enabled. > >>>> The Doorbell register is 16-bits, but is treated as two 8-bit values. >>>> =A0The >>>> upper 8-bits are used for the destination VM ID. =A0The lower 8-bits a= re >>>> the >>>> value which will be written to the destination VM and what the guest >>>> status >>>> register will be set to when the interrupt is trigger is the destinati= on >>>> guest. >>>> >>>> >>> >>> What happens when two interrupts are sent back-to-back to the same gues= t? >>> =A0Will the first status value be lost? >>> >> >> Right now, it would be. =A0I believe that eventfd has a counting >> semaphore option, that could prevent loss of status (but limits what >> the status could be). >> > > It only counts the number of interrupts (and kvm will coalesce them anywa= y). Right. > >> My understanding of uio_pci interrupt handling >> is fairly new, but we could have the uio driver store the interrupt >> statuses to avoid losing them. >> > > There's nowhere to store them if we use ioeventfd/irqfd. =A0I think it's = both > easier and more efficient to leave this to the application (to store into > shared memory). Agreed. Cam