Hi all,
This the RFC I'm preparing to send to upstream QEMU for initial RFC review. A couple of limitations: I've not updated the protocol with the new msg_token field yet. We only support a single device per bus (dev_num = 0). The kernel driver only works as a module, when building it into the kernel it panics.
-------------------
This adds virtio-msg, a new virtio transport. Virtio-msg works by exchanging messages over a bus and doesn't rely on trapping and emulating making it a good fit for a number of applications such as AMP, real-time and safety applications.
Together with the new transport, this series adds a PCI device that implements an AMP setup much like it would look if two SoC's would use virtio-msg across a PCI link.
The virtio-msg spec: https://github.com/Linaro/virtio-msg-spec/
Linux with virtio-msg: https://github.com/edgarigl/linux/tree/edgari/virtio-msg-6.17
To try it, first build Linux with the following as modules: CONFIG_VIRTIO_MSG=m CONFIG_VIRTIO_MSG_AMP=m CONFIG_VIRTIO_MSG_AMP_PCI=m
Boot linux in QEMU with a virtio-msg-amp-pci device, in this example with a virtio-net device attached to it (x86/q35 machine): -device virtio-msg-amp-pci -device virtio-net-device,netdev=n1,bus=/q35-pcihost/pcie.0/virtio-msg-amp-pci/vmsg.0 -netdev user,id=nc
Modprobe: modprobe virtio_msg_transport.ko modprobe virtio_msg_amp.ko modprobe virtio_msg_amp_pci.ko
You now should see the virtio device.
Cheers, Edgar
Edgar E. Iglesias (4): virtio: Introduce notify_queue virtio: Add virtio_queue_get_rings virtio: Add the virtio-msg transport virtio-msg-bus: amp-pci: Add generic AMP PCI device
hw/misc/Kconfig | 7 + hw/misc/meson.build | 1 + hw/misc/virtio-msg-amp-pci.c | 324 ++++++++++++ hw/virtio/Kconfig | 4 + hw/virtio/meson.build | 5 + hw/virtio/virtio-msg-bus.c | 89 ++++ hw/virtio/virtio-msg.c | 596 ++++++++++++++++++++++ hw/virtio/virtio.c | 23 + include/hw/virtio/virtio-bus.h | 1 + include/hw/virtio/virtio-msg-bus.h | 95 ++++ include/hw/virtio/virtio-msg-prot.h | 747 ++++++++++++++++++++++++++++ include/hw/virtio/virtio-msg.h | 45 ++ include/hw/virtio/virtio.h | 2 + 13 files changed, 1939 insertions(+) create mode 100644 hw/misc/virtio-msg-amp-pci.c create mode 100644 hw/virtio/virtio-msg-bus.c create mode 100644 hw/virtio/virtio-msg.c create mode 100644 include/hw/virtio/virtio-msg-bus.h create mode 100644 include/hw/virtio/virtio-msg-prot.h create mode 100644 include/hw/virtio/virtio-msg.h