On 13/05/2020 18:13, bdragon@FreeBSD.org wrote:
From: Brandon Bergren git@bdragon.rtk0.net
In qemu 9d7bd0826f2d19f88631ad7078662668148f7b5f, the behavior of vring processing was changed to not run whenever bus-mastering is disabled.
Since we were never enabling it in the first place, OpenBIOS was no longer able to access virtio disks on qemu.
Fix this by enabling bus-mastering before initializing.
Signed-off-by: Brandon Bergren git@bdragon.rtk0.net
drivers/pci.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/pci.c b/drivers/pci.c index 9d501d3..34ae69a 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -816,6 +816,9 @@ int virtio_blk_config_cb(const pci_config_t *config) return 0; }
- /* Enable bus mastering to ensure vring processing will run. */
- ob_pci_enable_bus_master(config);
- ob_virtio_init(config->path, "virtio-blk", common_cfg, device_cfg, notify_base, notify_mult, idx);
#endif
Hi Brandon,
Thanks a lot for this patch - I've been testing it this morning, and discovered that whilst it fixed virtio for qemu-system-sparc64, I was still unable to boot from a virtio device under qemu-system-ppc.
I've since discovered that this is because of another recent change in QEMU, so I'll queue this patch and post a follow-up which fixes the qemu-system-ppc boot issue for me.
ATB,
Mark.