target/mips: Use OPC_MUL instead of OPC__MXU_MUL
[qemu/ar7.git] / docs / system / ivshmem.rst
blobb03a48afa3ae7258bbe43490180fc5732b1f6c8c
1 .. _pcsys_005fivshmem:
3 Inter-VM Shared Memory device
4 -----------------------------
6 On Linux hosts, a shared memory device is available. The basic syntax
7 is:
9 .. parsed-literal::
11    |qemu_system_x86| -device ivshmem-plain,memdev=hostmem
13 where hostmem names a host memory backend. For a POSIX shared memory
14 backend, use something like
18    -object memory-backend-file,size=1M,share,mem-path=/dev/shm/ivshmem,id=hostmem
20 If desired, interrupts can be sent between guest VMs accessing the same
21 shared memory region. Interrupt support requires using a shared memory
22 server and using a chardev socket to connect to it. The code for the
23 shared memory server is qemu.git/contrib/ivshmem-server. An example
24 syntax when using the shared memory server is:
26 .. parsed-literal::
28    # First start the ivshmem server once and for all
29    ivshmem-server -p pidfile -S path -m shm-name -l shm-size -n vectors
31    # Then start your qemu instances with matching arguments
32    |qemu_system_x86| -device ivshmem-doorbell,vectors=vectors,chardev=id
33                     -chardev socket,path=path,id=id
35 When using the server, the guest will be assigned a VM ID (>=0) that
36 allows guests using the same server to communicate via interrupts.
37 Guests can read their VM ID from a device register (see
38 ivshmem-spec.txt).
40 Migration with ivshmem
41 ~~~~~~~~~~~~~~~~~~~~~~
43 With device property ``master=on``, the guest will copy the shared
44 memory on migration to the destination host. With ``master=off``, the
45 guest will not be able to migrate with the device attached. In the
46 latter case, the device should be detached and then reattached after
47 migration using the PCI hotplug support.
49 At most one of the devices sharing the same memory can be master. The
50 master must complete migration before you plug back the other devices.
52 ivshmem and hugepages
53 ~~~~~~~~~~~~~~~~~~~~~
55 Instead of specifying the <shm size> using POSIX shm, you may specify a
56 memory backend that has hugepage support:
58 .. parsed-literal::
60    |qemu_system_x86| -object memory-backend-file,size=1G,mem-path=/dev/hugepages/my-shmem-file,share,id=mb1
61                     -device ivshmem-plain,memdev=mb1
63 ivshmem-server also supports hugepages mount points with the ``-m``
64 memory path argument.