summaryrefslogtreecommitdiff
path: root/hw/virtio/vhost-user-scmi.c
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2022-02-01 17:31:11 +0100
committerVincent Guittot <vincent.guittot@linaro.org>2022-08-13 11:51:13 +0200
commit1baa715ebdc305e83bc98f3f6b416ac4e62e6d8a (patch)
treefaa29c3518ea3a3e939841bb05407a8162b356f9 /hw/virtio/vhost-user-scmi.c
parent717d828c9e7d8cd577d84bfe590e51993d1ce6e2 (diff)
virtio-mmio: support device mode
With device mode, the virtio-mmio behaves like the device side of the virtio-mmio transport layer instead of the driver side Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Diffstat (limited to 'hw/virtio/vhost-user-scmi.c')
-rw-r--r--hw/virtio/vhost-user-scmi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/virtio/vhost-user-scmi.c b/hw/virtio/vhost-user-scmi.c
index 10ead3c3e7..2bede14b88 100644
--- a/hw/virtio/vhost-user-scmi.c
+++ b/hw/virtio/vhost-user-scmi.c
@@ -90,6 +90,15 @@ static void vu_scmi_set_status(VirtIODevice *vdev, uint8_t status)
VHostUserSCMI *scmi = VHOST_USER_SCMI(vdev);
bool should_start = status & VIRTIO_CONFIG_S_DRIVER_OK;
+ /*
+ * When emulating device mode, we start backend as soon as features have
+ * been set in order to be notified when guest will set vring and flags
+ * like VIRTIO_CONFIG_S_DRIVER_OK
+ */
+ if (vdev->device_mode) {
+ should_start = status & VIRTIO_CONFIG_S_FEATURES_OK;
+ }
+
if (!vdev->vm_running) {
should_start = false;
}