07.02.2024 02:17, Michael Tokarev пишет:
Hi!
I come across an old qemu issue today, https://gitlab.com/qemu-project/qemu/-/issues/1115 . It seemed interesting, and since I do have several test win10 guests handy, I tested it with qemu built from tag v7.1.0. And observed the described behavior.
After digging deeper, it turns out the same bios, compiled using different gcc, produces either good or broken binaries. It is not the seabios itself, the diff is the gcc version.
In particular, on debian bookworm, gcc-12 produces seabios which breaks win10 boot. While on debian sid, gcc-13 produces working seabios from the same source.
Everything else can be anything - any qemu version, any seabios version, - any combination. Giving any combination, compile bios with gcc from bookworm - win10 does not boot; compile this same bios using gcc from sid - it works.
The binary in question is vgabios-stdvga.bin.
I tried compiling vgabios-stdvga.bin with gcc-11, - this one produces broken binary too.
This goes up to qemu version 8.1.0, and from where, version of compiler used to build seabios does not matter anymore.
This is a past already, yet it's a quite interesting (to me anyway) observation. Something was (or maybe still is?) quite fragile here.
Maybe it's a good idea to do some bisections, at least to find out when qemu started working again with "broken" bios, to understand the issue better.
Since current debian stable (bookworm) which has qemu-7.2 and which is unable to boot windows 10 guest in bios mode, I went on and bisected this one. And the bisection leads to v8.0.0-2024-gbf376f30:
commit bf376f3020dfd7bcb2c4158b4ffa85c04d44f56d (HEAD) Author: Suravee Suthikulpanit suravee.suthikulpanit@amd.com Date: Wed Jun 7 15:57:16 2023 -0500
hw/i386/pc: Default to use SMBIOS 3.0 for newer machine models
Currently, pc-q35 and pc-i44fx machine models are default to use SMBIOS 2.8 (32-bit entry point). Since SMBIOS 3.0 (64-bit entry point) is now fully supported since QEMU 7.0, default to use SMBIOS 3.0 for newer machine models. This is necessary to avoid the following message when launching a VM with large number of vcpus.
"SMBIOS 2.1 table length 66822 exceeds 65535"
Which wont help with 7.2 machine types (it changes defaults for 8.1+).
And yes, running current qemu with -M pc-q35-7.2 shows the same issue again.
So it might not be a gcc issue really, but just a too large bios and gcc-13 is able to produce more compact code which actually fits.
/mjt