Hello,

this came up because these rom files are somewhat difficult to build on
non-x86, and distributions that have problem with distributing blobs
verbatim may be missing them.

On Tue, Feb 18, 2025 at 01:38:42PM +0300, Michael Tokarev wrote:
> Hi!
> 
> Qemu system-mode emulation, when used with a NIC, loads a ROM file
> for network booting (and fails to start if such file is not provided).
> ROMs shipped in the source tarball are x86-only, so such loading does
> nothing on non-x86, where we just wasting guest memory, - since the
> ROM code can not be executed on the target architecture anyway.
> 
> These days, ipxe provides (UEFI) ROM files for architectures other than
> x86.  And these ROMs actually works, making it possible to network-boot
> qemu guests in UEFI mode.
> 
> Would it be possible to make ROMs target-arch-specific, and drop the
> ROM dependency/loading on non-x86 if there's no arch-specific ROM found?
> This probably requires machine version dependency, to make the machine
> migratable.  Currently, romfile is a static property of a device,
> independent of the architecture.

And for emulation of a specific device (eg. e1000) it makes sense that
it comes with a ROM, even if the architecture does not make use of it.
That's how the hardware looks. And while it may be unusual the ROM can
be empty, eg. because somebody used a tool to erase it. That is using an
empty ROM as a fallback is something that is reasonable emulation of the
hardware in question, or no ROM at all for devices like virtio.

> A similar question exists about seabios and vgabios - for example,
> virtio-vga device always tries to load vgabios.rom on all architectures,
> while on non-x86 it is useless.

In this case it is more dodgy. I vaguely recall some code for
interpreting these BIOSes somewhere. That is the x86 BIOS can run in
some emulation to provide the BIOS functionality on non-x86. Not sure
how much it's actually used in practice for the kinds of cards that qemu
emulates.

Thanks

Michal

Reply via email to