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.
status = efi_load_initrd(image, &addr, &size, hdr->initrd_addr_max, ULONG_MAX);
if (status != EFI_SUCCESS)
goto fail;
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");
goto fail;
}
return bzimage_addr; All of the routines before returning bzimage_addr returns successfully but nothing happens after this.
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.