From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50898 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBkje-0008Ld-A9 for qemu-devel@nongnu.org; Tue, 11 May 2010 04:22:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBkjc-0004v9-7I for qemu-devel@nongnu.org; Tue, 11 May 2010 04:22:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20387) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBkjc-0004v3-00 for qemu-devel@nongnu.org; Tue, 11 May 2010 04:22:36 -0400 Message-ID: <4BE90F3A.7020804@redhat.com> Date: Tue, 11 May 2010 11:03:06 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1271872408-22842-1-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-2-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-3-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-4-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-5-git-send-email-cam@cs.ualberta.ca> <4BE7F517.5010707@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v5 4/5] Inter-VM shared memory PCI device List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cam Macdonell Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 05/11/2010 02:17 AM, Cam Macdonell wrote: > On Mon, May 10, 2010 at 5:59 AM, Avi Kivity wrote: > >> On 04/21/2010 08:53 PM, Cam Macdonell wrote: >> >>> Support an inter-vm shared memory device that maps a shared-memory object >>> as a >>> PCI device in the guest. This patch also supports interrupts between >>> guest by >>> communicating over a unix domain socket. This patch applies to the >>> qemu-kvm >>> repository. >>> >>> -device ivshmem,size=[,shm=] >>> >>> Interrupts are supported between multiple VMs by using a shared memory >>> server >>> by using a chardev socket. >>> >>> -device ivshmem,size=[,shm=] >>> [,chardev=][,msi=on][,irqfd=on][,vectors=n] >>> -chardev socket,path=,id= >>> >>> (shared memory server is qemu.git/contrib/ivshmem-server) >>> >>> Sample programs and init scripts are in a git repo here: >>> >>> >>> +typedef struct EventfdEntry { >>> + PCIDevice *pdev; >>> + int vector; >>> +} EventfdEntry; >>> + >>> +typedef struct IVShmemState { >>> + PCIDevice dev; >>> + uint32_t intrmask; >>> + uint32_t intrstatus; >>> + uint32_t doorbell; >>> + >>> + CharDriverState * chr; >>> + CharDriverState ** eventfd_chr; >>> + int ivshmem_mmio_io_addr; >>> + >>> + pcibus_t mmio_addr; >>> + unsigned long ivshmem_offset; >>> + uint64_t ivshmem_size; /* size of shared memory region */ >>> + int shm_fd; /* shared memory file descriptor */ >>> + >>> + int nr_allocated_vms; >>> + /* array of eventfds for each guest */ >>> + int ** eventfds; >>> + /* keep track of # of eventfds for each guest*/ >>> + int * eventfds_posn_count; >>> >>> >> More readable: >> >> typedef struct Peer { >> int nb_eventfds; >> int *eventfds; >> } Peer; >> int nb_peers; >> Peer *peers; >> >> Does eventfd_chr need to be there as well? >> > No it does not, eventfd_chr store character devices for receiving > interrupts when irqfd is not available, so we only them for this > guest, not for our peers. > Ok. >> Does this need to be part of the state? >> > They are because they're passed in as qdev properties from the > command-line so I thought they needed to be in the state struct to be > assigned via DEFINE_PROP_... > Well I'm not q-ualified to comment on qdev, so I'm fine either way with this. -- error compiling committee.c: too many arguments to function