From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest Date: Thu, 25 Aug 2011 16:35:29 -0500 Message-ID: <4E56C021.4040909@codemonkey.ws> References: <20110824222510.GC14835@dancer.ca.sandia.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: penberg@kernel.org, Sasha Levin , kvm@vger.kernel.org To: David Evensky Return-path: Received: from mail-gy0-f174.google.com ([209.85.160.174]:47340 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753587Ab1HYVfd (ORCPT ); Thu, 25 Aug 2011 17:35:33 -0400 Received: by gya6 with SMTP id 6so2134153gya.19 for ; Thu, 25 Aug 2011 14:35:32 -0700 (PDT) In-Reply-To: <20110824222510.GC14835@dancer.ca.sandia.gov> Sender: kvm-owner@vger.kernel.org List-ID: On 08/24/2011 05:25 PM, David Evensky wrote: > > > This patch adds a PCI device that provides PCI device memory to the > guest. This memory in the guest exists as a shared memory segment in > the host. This is similar memory sharing capability of Nahanni > (ivshmem) available in QEMU. In this case, the shared memory segment > is exposed as a PCI BAR only. > > A new command line argument is added as: > --shmem pci:0xc8000000:16MB:handle=/newmem:create > > diff -uprN -X linux-kvm/Documentation/dontdiff linux-kvm/tools/kvm/include/kvm/pci-shmem.h linux-kvm_pci_shmem/tools/kvm/include/kvm/pci-shmem.h > --- linux-kvm/tools/kvm/include/kvm/pci-shmem.h 1969-12-31 16:00:00.000000000 -0800 > +++ linux-kvm_pci_shmem/tools/kvm/include/kvm/pci-shmem.h 2011-08-13 15:43:01.067953711 -0700 > @@ -0,0 +1,13 @@ > +#ifndef KVM__PCI_SHMEM_H > +#define KVM__PCI_SHMEM_H > + > +#include > +#include > + > +struct kvm; > +struct shmem_info; > + > +int pci_shmem__init(struct kvm *self); > +int pci_shmem__register_mem(struct shmem_info *si); > + > +#endif > diff -uprN -X linux-kvm/Documentation/dontdiff linux-kvm/tools/kvm/include/kvm/virtio-pci-dev.h linux-kvm_pci_shmem/tools/kvm/include/kvm/virtio-pci-dev.h > --- linux-kvm/tools/kvm/include/kvm/virtio-pci-dev.h 2011-08-09 15:38:48.760120973 -0700 > +++ linux-kvm_pci_shmem/tools/kvm/include/kvm/virtio-pci-dev.h 2011-08-18 10:06:12.171539230 -0700 > @@ -15,10 +15,13 @@ > #define PCI_DEVICE_ID_VIRTIO_BLN 0x1005 > #define PCI_DEVICE_ID_VIRTIO_P9 0x1009 > #define PCI_DEVICE_ID_VESA 0x2000 > +#define PCI_DEVICE_ID_PCI_SHMEM 0x0001 > > #define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4 > +#define PCI_VENDOR_ID_PCI_SHMEM 0x0001 > #define PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET 0x1af4 FYI, that's not a valid vendor and device ID. Perhaps the RH folks would be willing to reserve a portion of the device ID space in their vendor ID for ya'll to play around with. Regards, Anthony Liguori