All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] How to access to ivshmem device in VM ?
@ 2017-02-15 15:31 Sébastien Frémal
  2017-02-17  8:45 ` Marc-André Lureau
  0 siblings, 1 reply; 3+ messages in thread
From: Sébastien Frémal @ 2017-02-15 15:31 UTC (permalink / raw)
  To: qemu-devel

Hello !

I searched for a forum or a place where questions about QEMU can be asked,
but I found nothing except mailing lists. If there is a more appropriate
place for my question, do not hesitate to indicate it to me !!

So, I'm trying to use ivshmem to share memory pages between several VM. I
found many webpages documenting the set up of this device. I successfully
installed the mechanism in the host. I launched ivshmem-clients which
successfully connected to the server. The problem is that I can't
understand how to access to the shared memory pages in a VM. I launched my
VM with this command line :
sudo qemu-system-x86_64 -show-cursor -enable-kvm -drive
format=raw,file=/var/lib/libvirt/images/theRise.img -m 4096 -machine q35
-show-cursor -device ivshmem-doorbell,vectors=4,chardev=ivshmem -chardev
socket,path=/tmp/ivshmem_socket,id=ivshmem
(the server was launched with : sudo ivshmem-server -p
/var/run/ivshmem-server.pid -S /tmp/ivshmem_socket -M ivshmem -l 4K -n 4).

The VM executes properly (I just don't have a visible mouse cursor despite
the "-show-cursor" option, but it could be worse) but I have absolutely no
idea on how to access the ivshmem device. I firstly thought that the option
would add a new device in /dev but there is nothing special. I ran an
updatedb/locate ivshmem to check if there was something interesting on the
machine, but there is no results. I don't know which socket path I must
give to my ivshmem client in my VM so it can connect to my server. I
searched for this particular information on the web, but I found nothing.

Can someone indicate me how to connect to the ivshmem-server from a VM
please ?

Best regards,

Sebastien Fremal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] How to access to ivshmem device in VM ?
  2017-02-15 15:31 [Qemu-devel] How to access to ivshmem device in VM ? Sébastien Frémal
@ 2017-02-17  8:45 ` Marc-André Lureau
  2017-02-22 14:35   ` Sébastien Frémal
  0 siblings, 1 reply; 3+ messages in thread
From: Marc-André Lureau @ 2017-02-17  8:45 UTC (permalink / raw)
  To: Sébastien Frémal, qemu-devel

Hi

On Thu, Feb 16, 2017 at 12:02 AM Sébastien Frémal <
sebastien.fremal@gmail.com> wrote:

> Hello !
>
> I searched for a forum or a place where questions about QEMU can be asked,
> but I found nothing except mailing lists. If there is a more appropriate
> place for my question, do not hesitate to indicate it to me !!
>
> So, I'm trying to use ivshmem to share memory pages between several VM. I
> found many webpages documenting the set up of this device. I successfully
> installed the mechanism in the host. I launched ivshmem-clients which
> successfully connected to the server. The problem is that I can't
> understand how to access to the shared memory pages in a VM. I launched my
> VM with this command line :
> sudo qemu-system-x86_64 -show-cursor -enable-kvm -drive
> format=raw,file=/var/lib/libvirt/images/theRise.img -m 4096 -machine q35
> -show-cursor -device ivshmem-doorbell,vectors=4,chardev=ivshmem -chardev
> socket,path=/tmp/ivshmem_socket,id=ivshmem
> (the server was launched with : sudo ivshmem-server -p
> /var/run/ivshmem-server.pid -S /tmp/ivshmem_socket -M ivshmem -l 4K -n 4).
>
> The VM executes properly (I just don't have a visible mouse cursor despite
> the "-show-cursor" option, but it could be worse) but I have absolutely no
> idea on how to access the ivshmem device. I firstly thought that the option
> would add a new device in /dev but there is nothing special. I ran an
>

There is no guest driver for ivshmem, it's left deliberately open for any
usage.


> updatedb/locate ivshmem to check if there was something interesting on the
> machine, but there is no results. I don't know which socket path I must
> give to my ivshmem client in my VM so it can connect to my server. I
>

You give the socket path of the server, in your example /tmp/ivshmem_socket
is fine.


> searched for this particular information on the web, but I found nothing.
>
> Did you read http://nairobi-embedded.org/linux_pci_device_driver.html ?

Can someone indicate me how to connect to the ivshmem-server from a VM
> please ?
>
>
Your example should work.

Note that ivshmem is not well regarded by the qemu community, what are you
trying to accomplish?

cheers
-- 
Marc-André Lureau

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] How to access to ivshmem device in VM ?
  2017-02-17  8:45 ` Marc-André Lureau
@ 2017-02-22 14:35   ` Sébastien Frémal
  0 siblings, 0 replies; 3+ messages in thread
From: Sébastien Frémal @ 2017-02-22 14:35 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel

M. Lureau,

Thank you for your reply ! I had misunderstood some informations indicating
that the device would create an entry in the /dev/shm of virtual machines.
The lspci command assured me that the device is properly accessible in my
virtual machine.

 "Note that ivshmem is not well regarded by the qemu community, what are
you trying to accomplish?"

Ivshmem breaks one of the most important virtualization's principal : the
isolation of virtual machines. I know some people don't like it. I'm
working in the GPGPU context. We are working (again) on sharing available
GPUs of a physical machine between the virtual machines running on that
machine. To do so, we created a direct access shared buffer : data are
written and read directly in a ring buffer without any kind of copy. That
reduces transfer times but it requires memory pages to be shared between
communicating processes. I used to work with Xen but Xen was incompatible
with NVIDIA GPUs when I began working on this project. Therefore I went for
Qemu as it's compatible with GPGPU on NVIDIA ! Ivshmem is a danger for
public clusters, but it could bring speed-up for private infrastructures !

Best regards,

Sebastien Fremal
​

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-22 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15 15:31 [Qemu-devel] How to access to ivshmem device in VM ? Sébastien Frémal
2017-02-17  8:45 ` Marc-André Lureau
2017-02-22 14:35   ` Sébastien Frémal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.