On Wed, 31 Jan 2024, Peter Maydell wrote:
On Wed, 31 Jan 2024 at 10:29, Michael Tokarev <m...@tls.msk.ru> wrote:
qemu-system-aarch64 -device virtio-vga

this one loads vgabios-virtio.bin.  Why?
Does this bios work on aarch64 (or any other non-x86 arch)?
Should there may be some conditional in this and similar places?
The same is true for x86 pxe roms and other x86-only roms.

For the same reason that if you plug a PCI card with an
x86 BIOS ROM on it into a non-x86 system with a PCI bus,
the x86 code is still on the ROM, even if it's never
executed :-) Mostly the ROM is ignored and the guest kernel
drives the hardware directly without it.

For stuff we control like virtio-vga it would probably be
helpful to be able to drop the requirement for the binary
blob, just as a practical convenience for users.

One way to omit ROM per machine could be like in this patch:

https://patchew.org/QEMU/cover.1672868854.git.bala...@eik.bme.hu/e8d6aa41eeb0461d285fa4c12e0fff05d366e8fa.1672868854.git.bala...@eik.bme.hu/

maybe this could also work per device if the romfile property can be set from realize or reset method but would need to distinguish between default value or user provided value to not override the latter.

There are also some PPC machines that have BIOS emulator in firmware and would need the ROM to init the device but these have problems with QEMU's gcc compiled ROMs that contain i386 opcodes and can't run these.

Also ati-vga has some tables in the card ROM about timings that drivers read even if the machine did not run the ROM and there are Mac versions of cards with different ROMs so this may be something dependent on each device rather than machine architecture. We can say that devices that QEMU emulate are primarily PC cards so they come with a PC option ROM.

Regards,
BALATON Zoltan

Reply via email to