[PATCH 2/2] efi_loader: Fix kernel panic when FTRACE is enabled
Ilias Apalodimas
ilias.apalodimas at linaro.org
Wed Dec 17 11:39:56 CET 2025
Thanks Patrick,
On Wed, 17 Dec 2025 at 09:26, Patrick Rudolph
<patrick.rudolph at 9elements.com> wrote:
>
> When FTRACE is enabled the EFI runtime will call the tracing functions
> that are not marked as __efi_runtime and cause a kernel panic since
> the functions have been previously unmapped by the kernel.
>
> Resolve this issue by adding the 'notrace' attribute to '__efi_runtime'
> attribute and thus disable tracing the EFI runtime. If required this
> can be worked out latter.
>
So I agree with this. Fixing is just a matter of moving the missing
functions to the runtime section, but I don;t think it's worth it,
unless someone *really* wants to instrument runtime calls.
OTOH runtime calls in the OS are rare and very limited
Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> TEST=Can boot a UEFI compatible linux OS on qemu-q35 when U-Boot was
> built with FTRACE=1.
>
> Signed-off-by: Patrick Rudolph <patrick.rudolph at 9elements.com>
> ---
> include/efi_loader.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index 3e70ac07055..7a13c390cbe 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -66,7 +66,7 @@ struct bootflow;
> *
> * static __efi_runtime compute_my_table(void);
> */
> -#define __efi_runtime __section(".text.efi_runtime")
> +#define __efi_runtime __section(".text.efi_runtime") notrace
>
> /*
> * Call this with mmio_ptr as the _pointer_ to a pointer to an MMIO region
> --
> 2.52.0
>
More information about the U-Boot
mailing list