From: BALATON Zoltan <balaton@eik.bme.hu>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Michael Tokarev <mjt@tls.msk.ru>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: why various devices are loading x86 roms on non-x86 architectures?
Date: Wed, 31 Jan 2024 14:22:29 +0100 (CET) [thread overview]
Message-ID: <a2b12e13-1e6c-82d2-f1c5-63e76158945d@eik.bme.hu> (raw)
In-Reply-To: <CAFEAcA_qxALhqHgd0zO6v6ufTaHvmiyyHuCDcHZdxRvbh+x_Hg@mail.gmail.com>
On Wed, 31 Jan 2024, Peter Maydell wrote:
> On Wed, 31 Jan 2024 at 10:29, Michael Tokarev <mjt@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.balaton@eik.bme.hu/e8d6aa41eeb0461d285fa4c12e0fff05d366e8fa.1672868854.git.balaton@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
next prev parent reply other threads:[~2024-01-31 13:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 10:28 why various devices are loading x86 roms on non-x86 architectures? Michael Tokarev
2024-01-31 10:54 ` Jiaxun Yang
2024-01-31 13:00 ` Peter Maydell
2024-01-31 13:22 ` BALATON Zoltan [this message]
2024-02-01 10:08 ` Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a2b12e13-1e6c-82d2-f1c5-63e76158945d@eik.bme.hu \
--to=balaton@eik.bme.hu \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).