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

lxd/instance/qemu: Start using seabios as CSM firmware #12736

Merged

Conversation

mihalicyn
Copy link
Member

@mihalicyn mihalicyn commented Jan 17, 2024

It was discovered (https://bugzilla.tianocore.org/show_bug.cgi?id=4588) that CSM module was removed from the edk2 which means that we have to switch on the scheme with using SeaBIOS firmware directly.

Recently we have been doing some debugging around edk2/CSM module issue that was preventing some Linux distros from booting (CentOS/Fedora ones). It was found, that issue lays in the BIOS call (INT 13h / 02h) that reads sectors from the disk. Just after this bios call gets called from the Linux kernel earlyboot code (https://github.com/torvalds/linux/blob/052d534373b7ed33712a63d5e17b2b6cdbce84fd/arch/x86/boot/edd.c#L33) something terribly wrong happens with the memory which makes Linux kernel execution to fail later on during the uncompression. It was also discovered that Debian/Ubuntu has no this problem because EDD-related 16-bit code is getting skipped somehow which is a matter of some GRUB code/configuration differences between GRUB builds in RHEL-like distros and Debian-like ones. (I was able to boot Fedora kernel without any problems by using GRUB binary from Debian, and inversely, I was able to see Debian kernel boot failure by booting it from the Fedora's GRUB!). And yes, when SeaBIOS is used directly without edk2 then everything works flawlessly.

Anyways, with this PR we effectively fixing this issue and also stepping out from (surprisingly) abandoned edk2/CSM module.

lxd/instance/qemu: Start using seabios as CSM firmware

This adds support for directly using seabios as the CSM firmware rather
than using EDK2's chain boot feature. It also makes this behavior be the
preferred one for new CSM-enabled VMs.

The reason for this change is the removal of CSM support from recent EDK2.

Signed-off-by: Stéphane Graber <[email protected]>
(cherry picked from commit 1fcae668f6f000c2f44c9a9d76a6f8e80897d418)
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
License: Apache-2.0

Fixes #12730

@mihalicyn mihalicyn requested a review from tomponline as a code owner January 17, 2024 14:46
@mihalicyn mihalicyn requested a review from MusicDin January 17, 2024 15:55
@mihalicyn mihalicyn force-pushed the switch_to_seabios_from_edk2_csm branch from f13bdb3 to 6e87b5d Compare January 17, 2024 16:00
This adds support for directly using seabios as the CSM firmware rather
than using EDK2's chain boot feature. It also makes this behavior be the
preferred one for new CSM-enabled VMs.

The reason for this change is the removal of CSM support from recent EDK2.

Signed-off-by: Stéphane Graber <[email protected]>
(cherry picked from commit 1fcae668f6f000c2f44c9a9d76a6f8e80897d418)
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
License: Apache-2.0
@mihalicyn mihalicyn force-pushed the switch_to_seabios_from_edk2_csm branch from 6e87b5d to ee8a111 Compare January 17, 2024 16:12
@tomponline tomponline merged commit e7c87fb into canonical:main Jan 18, 2024
24 of 25 checks passed
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.

Switch to direct Seabios boot as CSM support has been removed
3 participants