On Thu, Mar 19, 2020 at 07:48:19PM -0400, Kevin O'Connor wrote:
On Thu, Mar 19, 2020 at 08:39:33AM +0100, Gerd Hoffmann wrote:
Use bootorder fw_cfg file to find bootable virtio-mmio devices. Also add a new virtio-mmio.c source file, providing a function to register virtio-mmio devices.
Can you expand on this? I'm not sure I understand what this patch does. It seems the bootorder file is used for device detection, but that seems odd.
Yes, it does exactly that.
virtio-mmio isn't a discoverable bus, so we need some way to find the devices. Right now qemu simply appends device information to the kernel command line. Seabios can look there too. That works only for direct kernel boot though, so I'm trying to find something better. The alternative is doing it like aarch64: declare devices in device tree, or in ACPI tables. device tree doesn't work very well in x86. ACPI works fine, so I think this is the way to go.
FYI: qemu patch series is here: https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg06144.html
seabios hasn't an ACPI parser though. (ab)using the bootorder file to find the virtio-mmio devices is the only other option we have, and it looked alot simpler than adding an ACPI parser ...
cheers, Gerd