xref: /openbmc/qemu/docs/system/multi-process.rst (revision f0984d40)
1.. _Multi-process QEMU:
2
3Multi-process QEMU
4==================
5
6This document describes how to configure and use multi-process qemu.
7For the design document refer to docs/devel/qemu-multiprocess.
8
91) Configuration
10----------------
11
12multi-process is enabled by default for targets that enable KVM
13
14
152) Usage
16--------
17
18Multi-process QEMU requires an orchestrator to launch.
19
20Following is a description of command-line used to launch mpqemu.
21
22* Orchestrator:
23
24  - The Orchestrator creates a unix socketpair
25
26  - It launches the remote process and passes one of the
27    sockets to it via command-line.
28
29  - It then launches QEMU and specifies the other socket as an option
30    to the Proxy device object
31
32* Remote Process:
33
34  - QEMU can enter remote process mode by using the "remote" machine
35    option.
36
37  - The orchestrator creates a "remote-object" with details about
38    the device and the file descriptor for the device
39
40  - The remaining options are no different from how one launches QEMU with
41    devices.
42
43  - Example command-line for the remote process is as follows:
44
45      /usr/bin/qemu-system-x86_64                                        \
46      -machine x-remote                                                  \
47      -device lsi53c895a,id=lsi0                                         \
48      -drive id=drive_image2,file=/build/ol7-nvme-test-1.qcow2           \
49      -device scsi-hd,id=drive2,drive=drive_image2,bus=lsi0.0,scsi-id=0  \
50      -object x-remote-object,id=robj1,devid=lsi0,fd=4,
51
52* QEMU:
53
54  - Since parts of the RAM are shared between QEMU & remote process, a
55    memory-backend-memfd is required to facilitate this, as follows:
56
57    -object memory-backend-memfd,id=mem,size=2G
58
59  - A "x-pci-proxy-dev" device is created for each of the PCI devices emulated
60    in the remote process. A "socket" sub-option specifies the other end of
61    unix channel created by orchestrator. The "id" sub-option must be specified
62    and should be the same as the "id" specified for the remote PCI device
63
64  - Example commandline for QEMU is as follows:
65
66      -device x-pci-proxy-dev,id=lsi0,socket=3
67