public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
@ 2025-03-10 12:10 memristor2 via groups.io
  2025-03-10 12:39 ` Ajan
  0 siblings, 1 reply; 11+ messages in thread
From: memristor2 via groups.io @ 2025-03-10 12:10 UTC (permalink / raw)
  To: devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 2529 bytes --]

Hello everyone,
This problem is something I have had struggling with for a while now.
The issue is that I built coreboot with and UEFIPayload/UniversalPayload eveything goes fine but when I try to boot Ubuntu the kernel simply hangs after exit_boot_services even though it returns with success. Windows didn't boot either but turning off the debug macros seemed to fix the issue and windows boots now, even though it has a more complicated process in booting after ExitBootServices since it calls RunTimeServices. I checked the kernel's code (using linux-5.19.1) every thing seems to be fine but somehow after the address of startup_32 is returned and called to, the system hangs.
This is part of the efi_main code inside the kernel:

status = efi_load_initrd(image, &addr, &size, hdr->initrd_addr_max,
ULONG_MAX);
if (status != EFI_SUCCESS)
gotofail;
if (size > 0) {
efi_set_u64_split(addr, &hdr->ramdisk_image,
&boot_params->ext_ramdisk_image);
efi_set_u64_split(size, &hdr->ramdisk_size,
&boot_params->ext_ramdisk_size);
}

/*
* If the boot loader gave us a value for secure_boot then we use that,
* otherwise we ask the BIOS.
*/
if (boot_params->secure_boot == efi_secureboot_mode_unset)
boot_params->secure_boot = efi_get_secureboot();

/* Ask the firmware to clear memory on unclean shutdown */
efi_enable_reset_attack_mitigation();

efi_random_get_seed();

efi_retrieve_tpm2_eventlog();

setup_graphics(boot_params);

setup_efi_pci(boot_params);

setup_quirks(boot_params, bzimage_addr, buffer_end - buffer_start);

status = exit_boot(boot_params, handle);
if (status != EFI_SUCCESS) {
efi_err("exit_boot() failed!\n");
gotofail;
}
returnbzimage_addr;
All of the routines before returning bzimage_addr returns successfully but nothing happens after this.
Could this be MemoryMap and adress relocation related?
I don't even know if this is an EDK2 issue or should I change a configuration in coreboot (I highly doubt it being the second one. That's why I am emailing here).
I should also add that RngDxe and Tpm2Dxe are not loaded but i don't think that would be the cause.
Any help is appreciated.

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121165): https://edk2.groups.io/g/devel/message/121165
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 8930 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-03-12 13:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10 12:10 [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload memristor2 via groups.io
2025-03-10 12:39 ` Ajan
2025-03-10 12:57   ` memristor2 via groups.io
2025-03-10 13:11     ` Ajan
2025-03-10 13:29       ` memristor2 via groups.io
2025-03-10 13:30         ` memristor2 via groups.io
2025-03-10 13:38           ` Ajan
2025-03-10 13:53             ` memristor2 via groups.io
     [not found]             ` <182B756C71707289.31525@groups.io>
2025-03-12 10:05               ` memristor2 via groups.io
2025-03-12 13:44                 ` Ajan
2025-03-12 13:46                   ` memristor2 via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox