From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54341 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdTZc-0004yi-MM for qemu-devel@nongnu.org; Mon, 26 Jul 2010 15:42:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdTYj-0007d7-32 for qemu-devel@nongnu.org; Mon, 26 Jul 2010 15:41:58 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:39098) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdTYi-0007cz-VI for qemu-devel@nongnu.org; Mon, 26 Jul 2010 15:41:57 -0400 Received: by gwb11 with SMTP id 11so220645gwb.4 for ; Mon, 26 Jul 2010 12:41:56 -0700 (PDT) Message-ID: <4C4DE501.2080202@codemonkey.ws> Date: Mon, 26 Jul 2010 14:41:53 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v7 0/4] Inter-VM shared memory device References: <1276633426-30995-1-git-send-email-cam@cs.ualberta.ca> <4C4D922C.3020608@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 07/26/2010 02:01 PM, Cam Macdonell wrote: > On Mon, Jul 26, 2010 at 7:48 AM, Anthony Liguori wrote: > >> On 06/15/2010 03:23 PM, Cam Macdonell wrote: >> >>> Latest patch for PCI shared memory device that maps a host shared memory >>> object >>> to be shared between guests >>> >>> >> Is this against qemu.git or qemu-kvm.git? It depends on functions like >> qemu_ram_map() which are not present in qemu.git (and are present in >> qemu-kvm.git). >> > It is against qemu-kvm.git. Is qemu_ram_map() going into qemu.git? > Another function I use (and virtio in qemu-kvm uses as well) is > kvm_set_irqfd() that is not qemu.git either. Do I need ifdef these > functions with CONFIG_KVM? > kvm_set_irqfd() is fine, it just needs to be ported. It should be there due to vhost though? qemu_ram_map() is more difficult. I would think the better approach would be to invert things. Instead of a "give me a stable mapping that is shared atomically with a guest to this ram region", I would go with "go create a ram region with this preallocated memory" and then just assume that afterwards, you can make use of it and it's exposed as atomic memory. They're both layering violations, but at least the later is encapsulated to just the shared memory driver. Regards, Anthony Liguori > Please advise as to how to handle these two functions and then I can > rebase against qemu.git. > > Thanks, > Cam > > >> Regards, >> >> Anthony Liguori >> >> >>> new in this series >>> >>> - replace marking memory from v6 with marking device as unmigratable >>> indicating >>> that it should be unplugged before migration and re-added after. >>> - 'peer' case changed to require removal before migration, only >>> 'master' >>> devices can be migrated while attached. >>> >>> v6 >>> - migration support with 'master' and 'peer' roles for guest to >>> determine >>> who "owns" memory >>> - modified phys_ram_dirty array for marking memory as not to be >>> migrated >>> >>> v5: >>> - fixed segfault for non-server case >>> - code style fixes >>> - removed limit on the number of guests >>> - shared memory server is now in qemu.git/contrib >>> - made ioeventfd setup function generic >>> - removed interrupts when guest joined (let application handle it) >>> >>> v4: >>> - moved to single Doorbell register and use datamatch to trigger >>> different >>> VMs rather than one register per eventfd >>> - remove writing arbitrary values to eventfds. Only values of 1 are >>> now >>> written to ensure correct usage >>> >>> Cam Macdonell (4): >>> Device specification for shared memory PCI device >>> Add function to assign ioeventfd to MMIO. >>> Support marking a device as non-migratable >>> Inter-VM shared memory PCI device >>> >>> Makefile.target | 3 + >>> docs/specs/ivshmem_device_spec.txt | 96 +++++ >>> hw/hw.h | 1 + >>> hw/ivshmem.c | 823 >>> ++++++++++++++++++++++++++++++++++++ >>> kvm-all.c | 32 ++ >>> kvm.h | 1 + >>> qemu-char.c | 6 + >>> qemu-char.h | 3 + >>> qemu-doc.texi | 43 ++ >>> savevm.c | 32 ++- >>> 10 files changed, 1037 insertions(+), 3 deletions(-) >>> create mode 100644 docs/specs/ivshmem_device_spec.txt >>> create mode 100644 hw/ivshmem.c >>> >>> >>> >>> >>> >> >>