diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index 9d5df683f882..64ceaa83aad9 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -772,12 +772,14 @@ static bool have_unsupported_snp_features(void) static void efi_get_seed(void *seed, int size) { + efi_info("Getting random seed for KASLR from EFI\n"); efi_get_random_bytes(size, seed); /* * This only updates seed[0] when running on 32-bit, but in that case, * seed[1] is not used anyway, as there is no virtual KASLR on 32-bit. */ + efi_info("Getting random seed for KASLR from image\n"); *(unsigned long *)seed ^= kaslr_get_random_long("EFI"); } @@ -806,12 +808,14 @@ static efi_status_t efi_decompress_kernel(unsigned long *kernel_entry) virt_addr &= ~(CONFIG_PHYSICAL_ALIGN - 1); } + efi_info("Allocating memory for image\n"); status = efi_random_alloc(alloc_size, CONFIG_PHYSICAL_ALIGN, &addr, seed[0], EFI_LOADER_CODE, EFI_X86_KERNEL_ALLOC_LIMIT); if (status != EFI_SUCCESS) return status; + efi_info("Calling decompress_kernel()\n"); entry = decompress_kernel((void *)addr, virt_addr, error); if (entry == ULONG_MAX) { efi_free(alloc_size, addr); @@ -820,6 +824,7 @@ static efi_status_t efi_decompress_kernel(unsigned long *kernel_entry) *kernel_entry = addr + entry; + efi_info("Adjusting memory protections\n"); efi_adjust_memory_range_protection(addr, kernel_total_size); return EFI_SUCCESS; @@ -866,11 +871,14 @@ void __noreturn efi_stub_entry(efi_handle_t handle, efi_warn("Ignoring DXE services table: invalid signature\n"); efi_dxe_table = NULL; } + efi_info("Using DXE services at %p\n", efi_dxe_table); } /* grab the memory attributes protocol if it exists */ efi_bs_call(locate_protocol, &guid, NULL, (void **)&memattr); + efi_info("Setting up 5 level paging\n"); + status = efi_setup_5level_paging(); if (status != EFI_SUCCESS) { efi_err("efi_setup_5level_paging() failed!\n"); @@ -878,6 +886,7 @@ void __noreturn efi_stub_entry(efi_handle_t handle, } #ifdef CONFIG_CMDLINE_BOOL + efi_info("Parsing built-in command line options\n"); status = efi_parse_options(CONFIG_CMDLINE); if (status != EFI_SUCCESS) { efi_err("Failed to parse options\n"); @@ -887,6 +896,7 @@ void __noreturn efi_stub_entry(efi_handle_t handle, if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) { unsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr | ((u64)boot_params->ext_cmd_line_ptr << 32)); + efi_info("Parsing provided command line options\n"); status = efi_parse_options((char *)cmdline_paddr); if (status != EFI_SUCCESS) { efi_err("Failed to parse options\n"); @@ -894,6 +904,7 @@ void __noreturn efi_stub_entry(efi_handle_t handle, } } + efi_info("Decompressing kernel\n"); status = efi_decompress_kernel(&kernel_entry); if (status != EFI_SUCCESS) { efi_err("Failed to decompress kernel\n"); @@ -909,6 +920,7 @@ void __noreturn efi_stub_entry(efi_handle_t handle, * arguments will be processed only if image is not NULL, which will be * the case only if we were loaded via the PE entry point. */ + efi_info("Loading initrd\n"); status = efi_load_initrd(image, hdr->initrd_addr_max, ULONG_MAX, &initrd); if (status != EFI_SUCCESS) @@ -943,6 +955,7 @@ void __noreturn efi_stub_entry(efi_handle_t handle, setup_unaccepted_memory(); + efi_info("Exiting boot services\n"); status = exit_boot(boot_params, handle); if (status != EFI_SUCCESS) { efi_err("exit_boot() failed!\n");