Skip to content
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

Use newest arm64 UEFI and amd64 OVMF CODE/VARS firmware #81

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

damdo
Copy link
Contributor

@damdo damdo commented Jan 27, 2025

This PR updates the arm64 UEFI firmware to a version newer than 2023.11, as running on qemu >= 9.0 can trigger a bug in the older versions of the EDK2 guest firmware, causing Synchronous Exception and potential bootloops.
See: #80

While doing so it updates the amd64 OVMF firmware, which now has removed support for the 2M firmware and only supports the 4M one. The 4M OVMF firmware comes with split CODE and VARS images, which need to be loaded as pflash drives in the qemu vm, rather than via the -bios flag.

For more details on the migration see: https://salsa.debian.org/qemu-team/edk2/-/blob/debian/latest/debian/howto-2M-to-4M-migration.md

Fixes #80

it updates the arm64 UEFI firmware to a version newer than 2023.11,
as running on qemu >= 9.0 can trigger a bug in the older versions of the EDK2 guest firmware,
causing Synchronous Exception and potential bootloops.

While doing so it updates the amd64 OVMF firmware, which now has removed
support for the 2M firmware and only supports the 4M one.
The 4M OVMF firmware comes with split CODE and VARS images, which need
to be loaded as pflash drives in the qemu vm, rather than via the -bios
flag.

For more details on the migration see: https://salsa.debian.org/qemu-team/edk2/-/blob/debian/latest/debian/howto-2M-to-4M-migration.md

Fixes gokrazy#80
@damdo damdo force-pushed the use-newer-uefi-firmware branch from 8206f74 to 8520312 Compare January 27, 2025 10:06
@stapelberg stapelberg merged commit 9a2d415 into gokrazy:main Jan 28, 2025
1 check passed
@stapelberg
Copy link
Contributor

Thank you! I verified that this works in QEMU 9 on my machine (which is what I typically use).

I don’t have an older QEMU handy, but using nix-shell and an older version of nixpkgs allowed me to test with QEMU 7 and indeed it works (with --arch=arm64 and without):

% nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-22.05.tar.gz -p qemu
[nix-shell:~/gokrazy/virtual]$ qemu-system-x86_64 --version
QEMU emulator version 7.0.0
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers

[nix-shell:~/gokrazy/virtual]$ gok vm run --arch=arm64                                                                                                                                                  
2025/01/28 18:58:23 building disk image
gokrazy gok g852031+ on GOARCH=amd64 GOOS=linux
[…]

@damdo
Copy link
Contributor Author

damdo commented Jan 28, 2025

Thanks for verifying! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gok vm --arch arm64: sometimes throws Synchronous Exception
2 participants