vhost-device/crates/scmi
Milan Zamazal ca8f181bcd scmi: Refactor device specification and creation
Making the device configuration polymorphic requires the device struct
to exist before the device parameters are checked and assigned to the
struct fields.  Which means wrapping the struct fields by Option
unnecessarily or introducing other data confusion.

Let's extract the device configuration from traits to plain functions
in order to keep the device struct's unencumbered.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
..
kernel/iio-dummy scmi: Kernel instructions and changes for IIO added 2023-09-04 16:15:33 +01:00
src scmi: Refactor device specification and creation 2023-09-04 16:15:33 +01:00
Cargo.toml scmi: Implement SCMI base protocol 2023-09-04 16:15:33 +01:00
LICENSE-APACHE scmi: Initial skeleton 2023-09-04 16:15:33 +01:00
LICENSE-BSD-3-Clause scmi: Initial skeleton 2023-09-04 16:15:33 +01:00
README.md scmi: Provide help for devices 2023-09-04 16:15:33 +01:00

vhost-device-scmi

This program is a vhost-user backend for a VirtIO SCMI device. It provides SCMI access to various entities on the host; not necessarily only those providing an SCMI interface themselves.

It is tested with QEMU's -device vhost-user-scmi-pci but should work with any virtual machine monitor (VMM) that supports vhost-user. See the Examples section below.

Synopsis

vhost-device-scmi [OPTIONS]

Options

.. program:: vhost-device-scmi

.. option:: -h, --help

Print help.

.. option:: -s, --socket-path=PATH

Location of the vhost-user Unix domain sockets.

.. option:: -d, --device=SPEC

SCMI device specification in the format ID,PROPERTY=VALUE,.... Can be used multiple times for multiple exposed devices. If no device is specified then no device will be provided to the guest OS but VirtIO SCMI will be still available there. Use help as the device ID to list help on all the available devices.

You can set RUST_LOG environment variable to debug to get maximum messages on the standard error output.

Examples

The daemon should be started first:

::

host# vhost-device-scmi --socket-path=scmi.sock --device fake,name=foo

The QEMU invocation needs to create a chardev socket the device can use to communicate as well as share the guests memory over a memfd:

::

host# qemu-system
-chardev socket,path=scmi.sock,id=scmi
-device vhost-user-scmi-pci,chardev=vscmi,id=scmi
-machine YOUR-MACHINE-OPTIONS,memory-backend=mem
-m 4096
-object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on
...

Supported SCMI protocols

The currently supported SCMI protocols are:

  • base
  • sensor management

Basically only the mandatory and necessary parts of the protocols are implemented.

Kernel support for testing

kernel subdirectory contains instructions how to create emulated industrial I/O devices for testing.

License

This project is licensed under either of

unless specified in particular files otherwise.