aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blockdev.c3
-rw-r--r--docs/specs/tpm.rst2
-rw-r--r--docs/system/arm/xenpvh.rst39
-rw-r--r--include/hw/xen/xen_native.h2
-rw-r--r--meson.build17
5 files changed, 37 insertions, 26 deletions
diff --git a/blockdev.c b/blockdev.c
index 4c1177e8db..c91f49e7b6 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2400,8 +2400,9 @@ void coroutine_fn qmp_block_resize(const char *device, const char *node_name,
bdrv_co_lock(bs);
bdrv_drained_end(bs);
- blk_co_unref(blk);
bdrv_co_unlock(bs);
+
+ blk_co_unref(blk);
}
void qmp_block_stream(const char *job_id, const char *device,
diff --git a/docs/specs/tpm.rst b/docs/specs/tpm.rst
index efe124a148..c96776a369 100644
--- a/docs/specs/tpm.rst
+++ b/docs/specs/tpm.rst
@@ -1,3 +1,5 @@
+.. _tpm-device:
+
===============
QEMU TPM Device
===============
diff --git a/docs/system/arm/xenpvh.rst b/docs/system/arm/xenpvh.rst
index e1655c7ab8..430ac2c02e 100644
--- a/docs/system/arm/xenpvh.rst
+++ b/docs/system/arm/xenpvh.rst
@@ -1,34 +1,39 @@
-XENPVH (``xenpvh``)
+Xen Device Emulation Backend (``xenpvh``)
=========================================
-This machine creates a IOREQ server to register/connect with Xen Hypervisor.
-When TPM is enabled, this machine also creates a tpm-tis-device at a user input
-tpm base address, adds a TPM emulator and connects to a swtpm application
-running on host machine via chardev socket. This enables xenpvh to support TPM
-functionalities for a guest domain.
+This machine is a little unusual compared to others as QEMU just acts
+as an IOREQ server to register/connect with Xen Hypervisor. Control of
+the VMs themselves is left to the Xen tooling.
-More information about TPM use and installing swtpm linux application can be
-found at: docs/specs/tpm.rst.
+When TPM is enabled, this machine also creates a tpm-tis-device at a
+user input tpm base address, adds a TPM emulator and connects to a
+swtpm application running on host machine via chardev socket. This
+enables xenpvh to support TPM functionalities for a guest domain.
+
+More information about TPM use and installing swtpm linux application
+can be found in the :ref:`tpm-device` section.
Example for starting swtpm on host machine:
+
.. code-block:: console
mkdir /tmp/vtpm2
swtpm socket --tpmstate dir=/tmp/vtpm2 \
- --ctrl type=unixio,path=/tmp/vtpm2/swtpm-sock &
+ --ctrl type=unixio,path=/tmp/vtpm2/swtpm-sock &
Sample QEMU xenpvh commands for running and connecting with Xen:
+
.. code-block:: console
qemu-system-aarch64 -xen-domid 1 \
- -chardev socket,id=libxl-cmd,path=qmp-libxl-1,server=on,wait=off \
- -mon chardev=libxl-cmd,mode=control \
- -chardev socket,id=libxenstat-cmd,path=qmp-libxenstat-1,server=on,wait=off \
- -mon chardev=libxenstat-cmd,mode=control \
- -xen-attach -name guest0 -vnc none -display none -nographic \
- -machine xenpvh -m 1301 \
- -chardev socket,id=chrtpm,path=tmp/vtpm2/swtpm-sock \
- -tpmdev emulator,id=tpm0,chardev=chrtpm -machine tpm-base-addr=0x0C000000
+ -chardev socket,id=libxl-cmd,path=qmp-libxl-1,server=on,wait=off \
+ -mon chardev=libxl-cmd,mode=control \
+ -chardev socket,id=libxenstat-cmd,path=qmp-libxenstat-1,server=on,wait=off \
+ -mon chardev=libxenstat-cmd,mode=control \
+ -xen-attach -name guest0 -vnc none -display none -nographic \
+ -machine xenpvh -m 1301 \
+ -chardev socket,id=chrtpm,path=tmp/vtpm2/swtpm-sock \
+ -tpmdev emulator,id=tpm0,chardev=chrtpm -machine tpm-base-addr=0x0C000000
In above QEMU command, last two lines are for connecting xenpvh QEMU to swtpm
via chardev socket.
diff --git a/include/hw/xen/xen_native.h b/include/hw/xen/xen_native.h
index 6f09c48823..1a5ad693a4 100644
--- a/include/hw/xen/xen_native.h
+++ b/include/hw/xen/xen_native.h
@@ -532,7 +532,7 @@ static inline int xendevicemodel_set_irq_level(xendevicemodel_handle *dmod,
}
#endif
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION <= 41700
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 41700
#define GUEST_VIRTIO_MMIO_BASE xen_mk_ullong(0x02000000)
#define GUEST_VIRTIO_MMIO_SIZE xen_mk_ullong(0x00100000)
#define GUEST_VIRTIO_MMIO_SPI_FIRST 33
diff --git a/meson.build b/meson.build
index d2c4c2adb3..6c77d9687d 100644
--- a/meson.build
+++ b/meson.build
@@ -123,21 +123,24 @@ if get_option('kvm').allowed() and targetos == 'linux'
kvm_targets_c = '"' + '" ,"'.join(kvm_targets) + '"'
endif
config_host_data.set('CONFIG_KVM_TARGETS', kvm_targets_c)
-
accelerator_targets = { 'CONFIG_KVM': kvm_targets }
+if cpu in ['x86', 'x86_64']
+ xen_targets = ['i386-softmmu', 'x86_64-softmmu']
+elif cpu in ['arm', 'aarch64']
+ # i386 emulator provides xenpv machine type for multiple architectures
+ xen_targets = ['i386-softmmu', 'x86_64-softmmu', 'aarch64-softmmu']
+else
+ xen_targets = []
+endif
+accelerator_targets += { 'CONFIG_XEN': xen_targets }
+
if cpu in ['aarch64']
accelerator_targets += {
'CONFIG_HVF': ['aarch64-softmmu']
}
endif
-if cpu in ['x86', 'x86_64', 'arm', 'aarch64']
- # i386 emulator provides xenpv machine type for multiple architectures
- accelerator_targets += {
- 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu', 'aarch64-softmmu'],
- }
-endif
if cpu in ['x86', 'x86_64']
accelerator_targets += {
'CONFIG_HVF': ['x86_64-softmmu'],