[PATCH] efi/libstub: Make efi_cache_sync_image() always available
From: Thierry Reding
Date: Tue Apr 28 2026 - 06:05:30 EST
Currently this is only available when zboot is included. Make sure it's
always there to allow using it from other places in the EFI stub.
Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
---
drivers/firmware/efi/libstub/efi-stub.c | 7 +++++++
drivers/firmware/efi/libstub/zboot.c | 7 -------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index 42d6073bcd06..6d635dddfa36 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -48,6 +48,13 @@
static u64 virtmap_base = EFI_RT_VIRTUAL_BASE;
static bool flat_va_mapping = (EFI_RT_VIRTUAL_OFFSET != 0);
+void __weak efi_cache_sync_image(unsigned long image_base,
+ unsigned long alloc_size)
+{
+ // Provided by the arch to perform the cache maintenance necessary for
+ // executable code loaded into memory to be safe for execution.
+}
+
void __weak free_primary_display(struct sysfb_display_info *dpy)
{ }
diff --git a/drivers/firmware/efi/libstub/zboot.c b/drivers/firmware/efi/libstub/zboot.c
index 4b76f74c56da..d77c8059533f 100644
--- a/drivers/firmware/efi/libstub/zboot.c
+++ b/drivers/firmware/efi/libstub/zboot.c
@@ -19,13 +19,6 @@ static unsigned long alloc_preferred_address(unsigned long alloc_size)
return ULONG_MAX;
}
-void __weak efi_cache_sync_image(unsigned long image_base,
- unsigned long alloc_size)
-{
- // Provided by the arch to perform the cache maintenance necessary for
- // executable code loaded into memory to be safe for execution.
-}
-
struct sysfb_display_info *alloc_primary_display(void)
{
return __alloc_primary_display();
--
2.52.0
--- >8 ---