Re: [PATCH v4 3/3] Inter-VM shared memory PCI device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 12, 2010 at 2:56 PM, Avi Kivity <avi@xxxxxxxxxx> wrote:
> On 04/08/2010 01:52 AM, 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=<size in MB>[,shm=<shm name>]
>>
>
> Can that be <size in format accepted by -m> (2M, 4G, 19T, ...).
>
>> Interrupts are supported between multiple VMs by using a shared memory
>> server
>> by using a chardev socket.
>>
>>     -device ivshmem,size=<size in MB>[,shm=<shm
>> name>][,chardev=<id>][,msi=on]
>>             [,irqfd=on][,vectors=n]
>>     -chardev socket,path=<path>,id=<id>
>>
>
> Do we need the irqfd parameter?  Should be on by default.
>
> On the other hand, it may fail with older kernels with limited irqfd slots,
> so better keep it there.
>
>> Sample programs, init scripts and the shared memory server are available
>> in a
>> git repo here:
>>
>>     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

>
>> ---
>>  Makefile.target |    3 +
>>  hw/ivshmem.c    |  700
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  qemu-char.c     |    6 +
>>  qemu-char.h     |    3 +
>>
>
> 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"?

>
>>  4 files changed, 712 insertions(+), 0 deletions(-)
>>  create 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) += usb-ohci.o
>>  obj-y += rtl8139.o
>>  obj-y += e1000.o
>>
>> +# Inter-VM PCI shared memory
>> +obj-y += ivshmem.o
>> +
>>
>
> depends on CONFIG_PCI

as in

obj-($CONFIG_PCI) += 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) {
>> +
>> +    s->shm_fd = fd;
>> +
>> +    s->ivshmem_offset = qemu_ram_mmap(s->shm_fd, s->ivshmem_size,
>> +             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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux