| 1 | Xen Device Emulation Backend (``xenpvh``) |
| 2 | ========================================= |
| 3 | |
| 4 | This machine is a little unusual compared to others as QEMU just acts |
| 5 | as an IOREQ server to register/connect with Xen Hypervisor. Control of |
| 6 | the VMs themselves is left to the Xen tooling. |
| 7 | |
| 8 | When TPM is enabled, this machine also creates a tpm-tis-device at a |
| 9 | user input tpm base address, adds a TPM emulator and connects to a |
| 10 | swtpm application running on host machine via chardev socket. This |
| 11 | enables xenpvh to support TPM functionalities for a guest domain. |
| 12 | |
| 13 | More information about TPM use and installing swtpm linux application |
| 14 | can be found in the :ref:`tpm-device` section. |
| 15 | |
| 16 | Example for starting swtpm on host machine: |
| 17 | |
| 18 | .. code-block:: console |
| 19 | |
| 20 | mkdir /tmp/vtpm2 |
| 21 | swtpm socket --tpmstate dir=/tmp/vtpm2 \ |
| 22 | --ctrl type=unixio,path=/tmp/vtpm2/swtpm-sock & |
| 23 | |
| 24 | Sample QEMU xenpvh commands for running and connecting with Xen: |
| 25 | |
| 26 | .. code-block:: console |
| 27 | |
| 28 | qemu-system-aarch64 -xen-domid 1 \ |
| 29 | -chardev socket,id=libxl-cmd,path=qmp-libxl-1,server=on,wait=off \ |
| 30 | -object monitor-qmp,id=qmp0,chardev=libxl-cmd \ |
| 31 | -chardev socket,id=libxenstat-cmd,path=qmp-libxenstat-1,server=on,wait=off \ |
| 32 | -object monitor-qmp,id=qmp1,chardev=libxenstat-cmd \ |
| 33 | -xen-attach -name guest0 -vnc none -display none -nographic \ |
| 34 | -machine xenpvh -m 1301 \ |
| 35 | -chardev socket,id=chrtpm,path=tmp/vtpm2/swtpm-sock \ |
| 36 | -tpmdev emulator,id=tpm0,chardev=chrtpm -machine tpm-base-addr=0x0C000000 |
| 37 | |
| 38 | In above QEMU command, last two lines are for connecting xenpvh QEMU to swtpm |
| 39 | via chardev socket. |