On Fri, Mar 20, 2020 at 07:13:02AM +0100, Gerd Hoffmann wrote:
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.
I'd be leery of overloading the bootorder file in this way. The QEMU to firmware interface is already complex and additional quirks like this make it harder to document and understand that interface.
Can we just introduce a new fw_cfg file (eg, /etc/virtio-mmio-devices) with the required information?
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 ...
If you mean a DSDT parser then I suspect a full implementation in SeaBIOS would be too burdensome. However, it might be possible to introduce a minimal DSDT parser (eg, one that only supports extracting constants).
FWIW, it's unclear to me if adding a parser would be a net gain when compared to adding adhoc fw_cfg files. In particular, it seems some users don't want to enable acpi.