xref: /openbmc/qemu/docs/system/arm/xenpvh.rst (revision 06ecb6ac197d8e87f91579d803194647dc24cd65)
1*06ecb6acSAlex BennéeXen Device Emulation Backend (``xenpvh``)
2733766cdSVikram Garhwal=========================================
3733766cdSVikram Garhwal
4*06ecb6acSAlex BennéeThis machine is a little unusual compared to others as QEMU just acts
5*06ecb6acSAlex Bennéeas an IOREQ server to register/connect with Xen Hypervisor. Control of
6*06ecb6acSAlex Bennéethe VMs themselves is left to the Xen tooling.
7733766cdSVikram Garhwal
8*06ecb6acSAlex BennéeWhen TPM is enabled, this machine also creates a tpm-tis-device at a
9*06ecb6acSAlex Bennéeuser input tpm base address, adds a TPM emulator and connects to a
10*06ecb6acSAlex Bennéeswtpm application running on host machine via chardev socket. This
11*06ecb6acSAlex Bennéeenables xenpvh to support TPM functionalities for a guest domain.
12*06ecb6acSAlex Bennée
13*06ecb6acSAlex BennéeMore information about TPM use and installing swtpm linux application
14*06ecb6acSAlex Bennéecan be found in the :ref:`tpm-device` section.
15733766cdSVikram Garhwal
16733766cdSVikram GarhwalExample for starting swtpm on host machine:
17*06ecb6acSAlex Bennée
18733766cdSVikram Garhwal.. code-block:: console
19733766cdSVikram Garhwal
20733766cdSVikram Garhwal    mkdir /tmp/vtpm2
21733766cdSVikram Garhwal    swtpm socket --tpmstate dir=/tmp/vtpm2 \
22733766cdSVikram Garhwal      --ctrl type=unixio,path=/tmp/vtpm2/swtpm-sock &
23733766cdSVikram Garhwal
24733766cdSVikram GarhwalSample QEMU xenpvh commands for running and connecting with Xen:
25*06ecb6acSAlex Bennée
26733766cdSVikram Garhwal.. code-block:: console
27733766cdSVikram Garhwal
28733766cdSVikram Garhwal    qemu-system-aarch64 -xen-domid 1 \
29733766cdSVikram Garhwal      -chardev socket,id=libxl-cmd,path=qmp-libxl-1,server=on,wait=off \
30733766cdSVikram Garhwal      -mon chardev=libxl-cmd,mode=control \
31733766cdSVikram Garhwal      -chardev socket,id=libxenstat-cmd,path=qmp-libxenstat-1,server=on,wait=off \
32733766cdSVikram Garhwal      -mon chardev=libxenstat-cmd,mode=control \
33733766cdSVikram Garhwal      -xen-attach -name guest0 -vnc none -display none -nographic \
34733766cdSVikram Garhwal      -machine xenpvh -m 1301 \
35733766cdSVikram Garhwal      -chardev socket,id=chrtpm,path=tmp/vtpm2/swtpm-sock \
36733766cdSVikram Garhwal      -tpmdev emulator,id=tpm0,chardev=chrtpm -machine tpm-base-addr=0x0C000000
37733766cdSVikram Garhwal
38733766cdSVikram GarhwalIn above QEMU command, last two lines are for connecting xenpvh QEMU to swtpm
39733766cdSVikram Garhwalvia chardev socket.
40