On Fri, Aug 01, 2025 at 02:55:28PM +0100, Daniel P. Berrangé wrote: > On Tue, Jul 01, 2025 at 02:18:15PM +0200, Oliver Steffen wrote: > > From: Gerd Hoffmann <kra...@redhat.com> > > > > Add virtio-mmio slots to the q35 machine model, intended to be used by > > an SVSM. > > > > Disabled by default, enable using '-machine q35,x-svsm-virtio-mmio=on'. > > > > When enabled it is possible to plug up to 4 virtio devices into the > > slots virtio-mmio using '-device virtio-${kind}-device'. > > > > The devices can be found at base address 0xfef00000, each slot on a > > separate page. No IRQ is wired up, the SVSM has to drive the devices > > in polling mode. > > > > The base addresses are communicated to the SVSM via the etc/hardware-info > > fw_cfg file. > > This feels a somewhat uncomfortable in that it ties QEMU to specific > impl details of SVSM at a point in time. > > With the IGVM support for loading guest firmware, we've avoided QEMU > needing any knowledge of what the firmware actually is. It is just > an opaque blob that is loaded based on its own IGVM metadata. This > also made it possible for any hypervisor with IGVM support to be able > to load any firmware, including SVSM or equiv impls.
Well, there isn't anything svsm-specific in there, it is just that svsm is the only user right now (and I don't expect that to change anytime soon). But we could very well rename the option to "virtio-mmio=on". > Is there any way to extend IGVM to express that it supports these > 4 virtio-mmio slots, at the given address in polling mode, so that > hypervisors can auto-discover this facility ? You mean some igvm directive requesting that qemu creates virtio-mmio slots? Should be possible. Not sure how much of a win that would actually be though. You still have to create the devices and the corresponding backends on the qemu command line. > Failing that, can we make it possible to create virtio-mmio slots > on the QEMU command line, instead of hardcoding this SVSM-specific > setup in QEMU code. That would work too. take care, Gerd