From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2C24-0001x5-6S for qemu-devel@nongnu.org; Wed, 14 Apr 2010 19:30:08 -0400 Received: from [140.186.70.92] (port=49719 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2C22-0001uq-Nb for qemu-devel@nongnu.org; Wed, 14 Apr 2010 19:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2C20-0006V2-Eq for qemu-devel@nongnu.org; Wed, 14 Apr 2010 19:30:06 -0400 Received: from mail-gx0-f218.google.com ([209.85.217.218]:49011) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2C20-0006Uj-C9 for qemu-devel@nongnu.org; Wed, 14 Apr 2010 19:30:04 -0400 Received: by gxk10 with SMTP id 10so368043gxk.10 for ; Wed, 14 Apr 2010 16:30:02 -0700 (PDT) MIME-Version: 1.0 Sender: camm@ualberta.ca In-Reply-To: <4BC388EF.8000706@redhat.com> References: <1270680720-8457-1-git-send-email-cam@cs.ualberta.ca> <1270680720-8457-2-git-send-email-cam@cs.ualberta.ca> <1270680720-8457-3-git-send-email-cam@cs.ualberta.ca> <1270680720-8457-4-git-send-email-cam@cs.ualberta.ca> <4BC388EF.8000706@redhat.com> Date: Wed, 14 Apr 2010 17:30:01 -0600 Message-ID: From: Cam Macdonell Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH v4 3/3] 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 Mon, Apr 12, 2010 at 2:56 PM, Avi Kivity wrote: > On 04/08/2010 01:52 AM, Cam Macdonell wrote: >> >> Support an inter-vm shared memory device that maps a shared-memory objec= t >> as a >> PCI device in the guest. =A0This patch also supports interrupts between >> guest by >> communicating over a unix domain socket. =A0This patch applies to the >> qemu-kvm >> repository. >> >> =A0 =A0 -device ivshmem,size=3D[,shm=3D] >> > > Can that be (2M, 4G, 19T, ...). > >> Interrupts are supported between multiple VMs by using a shared memory >> server >> by using a chardev socket. >> >> =A0 =A0 -device ivshmem,size=3D[,shm=3D> name>][,chardev=3D][,msi=3Don] >> =A0 =A0 =A0 =A0 =A0 =A0 [,irqfd=3Don][,vectors=3Dn] >> =A0 =A0 -chardev socket,path=3D,id=3D >> > > Do we need the irqfd parameter? =A0Should be on by default. > > On the other hand, it may fail with older kernels with limited irqfd slot= s, > so better keep it there. > >> Sample programs, init scripts and the shared memory server are available >> in a >> git repo here: >> >> =A0 =A0 www.gitorious.org/nahanni >> > > Please consider qemu.git/contrib. Should the compilation be tied into Qemu's regular build with a switch (e.g. --enable-ivshmem-server)? Or should it be its own separate build? Cam > >> --- >> =A0Makefile.target | =A0 =A03 + >> =A0hw/ivshmem.c =A0 =A0| =A0700 >> +++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> =A0qemu-char.c =A0 =A0 | =A0 =A06 + >> =A0qemu-char.h =A0 =A0 | =A0 =A03 + >> > > qemu-doc.texi | 45 +++++++++++++ Seems to be light on qdev devices. I notice there is a section named "Data Type Index" that "could be used for qdev device names and options", but is currently empty. Should I place documentation there of device there or just add it to "3.3 Invocation"? > >> =A04 files changed, 712 insertions(+), 0 deletions(-) >> =A0create mode 100644 hw/ivshmem.c >> >> diff --git a/Makefile.target b/Makefile.target >> index 1ffd802..bc9a681 100644 >> --- a/Makefile.target >> +++ b/Makefile.target >> @@ -199,6 +199,9 @@ obj-$(CONFIG_USB_OHCI) +=3D usb-ohci.o >> =A0obj-y +=3D rtl8139.o >> =A0obj-y +=3D e1000.o >> >> +# Inter-VM PCI shared memory >> +obj-y +=3D ivshmem.o >> + >> > > depends on CONFIG_PCI as in obj-($CONFIG_PCI) +=3D ivshmem.o the variable CONFIG_PCI doesn't seem to be set during configuration. I don't see any other PCI devices that depend on it. Do we also want to depend on CONFIG_KVM? >> +static void create_shared_memory_BAR(IVShmemState *s, int fd) { >> + >> + =A0 =A0s->shm_fd =3D fd; >> + >> + =A0 =A0s->ivshmem_offset =3D qemu_ram_mmap(s->shm_fd, s->ivshmem_size, >> + =A0 =A0 =A0 =A0 =A0 =A0 MAP_SHARED, 0); >> > > Where did the offset go? 0 is the offset. I include the offset parameter in qemu_ram_mmap() to make it flexible for other uses. Are you suggesting to take an optional offset as an argument to -device? Cam