-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues found while integrating Clover with QEMU #527
Comments
clone the Clover into your local disk. |
Yes, that would work, because the launch script doesn't use any of the options I mentioned above. If I look at the file, it seems to use these options:
I can make Clover work in qemu as well if I don't use So I would like it if Clover could be made to work in qemu even if |
Why -cpu max? There is Penryn as best solution. |
Penryn won't work as many Linux distributions are looking to switch to x86-64-v2 which Penryn doesn't support. Ideally Clover would work regardless of what CPU type is selected in qemu |
Make debug.log in Clover to see if there is a problem in Clover itself. |
I enabled Debug in my config.plist but there is no debug log in EFI/CLOVER/misc after boot, even when I do a successful boot without using -cpu max, -nographic or if=virtio. My config.plist can be found here: systemd/mkosi@22209fe |
I built Clover locally with It'd be great if the serial console could be enabled by default in clover without enabling extra debugging, but I also wouldn't mind if it was able to boot without a serial console when no graphics device is available. |
Serial console debug logs when booting with
|
Serial console debug logs when booting with
|
Hang with -cpu=max is easy. QEMU emalates CoffeLake CPU but don't emulate MSR for energy bias. So crash. |
Thanks for the hint! I found /sys/modules/kvm/parameters/ignore_msrs which instructs KVM to not crash on MSRs that are not emulated. Enabling that fixes booting with
For virtio, it's a custom protocol that seems to need custom support in the bootloader? I found implementations for OVMF (See the Virtio folders here) and SeaBIOS (see the virtio files here). I guess Clover would require custom support for the virtio protocol as well? |
Similar screen appear if I try to boot efi/bios usb stick prepared via ArchWiki article on two machines with real CPUs : one is AMD FX4300 CPU on Asrock 760gm-hdv - no real UEFI here. Another machine is HP ProBook 4730s with i5-2450m (also somewhat strange UEFI? it exist in bios settings, but can't boot from usb stick I formatted as pure UEFI setup) |
hm, strange enough building on Linux with cross gcc 11.4.0 and clang++ 17.0.6 (hopefully) creates bootable on qemu with -enable-kvm and -cpu host iso for some reason main buildme script demands xcode for creating ISO yet I can run manually
and it will work. No nice graphical menu but at least textual interface show up. I modded BaseTools/Conf/tools_def.template for my specific crosscompiler in /opt/kgcc64 (c-only for kernel builds) and BaseTools/Source/C/Makefiles/header.makefile
because Werror there was breaking compile in brotli headers for me (vla error) |
I'm trying to get rid of all the BIOS logic in mkosi by emulating UEFI on BIOS using Clover. mkosi is an image builder that produces bootable disk images. My WIP PR can be found here. The commit that adds clover is this one.
I managed to get a bootable image that chainloads systemd-boot in QEMU's SeaBIOS using Clover, but with a few caveats:
if=virtio
option to load the disk image makes qemu hang on boot when using Clover-cpu max
option leads to a CPU exception on boot in qemu when using Clover-nographic
option also makes qemu hang on boot when using CloverThese issues can be reproduced by cloning the PR branch, and running the following command from within the mkosi repository root directory:
If you undo the
-cpu max
orif=virtio
changes in therun_qemu_cmdline()
function, qemu will also fail in the ways described above.Let me know if I should come up with an easier reproducer. If needed I can attach a generated disk image along with a qemu cmdline to boot it as well.
A picture of the CPU exception when booting Clover in SeaBIOS with
-cpu max
:When qemu hangs on boot when using
-nographic
, the following output is shown before qemu hangs:qemu also starts busy looping on its assigned CPU core when this happens
The text was updated successfully, but these errors were encountered: