[RESEND PATCH v2 1/2] efi/loongarch: Implement efi_cache_sync_image()
From: WANG Rui
Date: Mon Apr 27 2026 - 04:48:08 EST
Provide a LoongArch implementation of efi_cache_sync_image() to ensure
instruction cache coherency after the kernel image is relocated.
Signed-off-by: WANG Rui <r@xxxxxx>
Reviewed-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>
---
drivers/firmware/efi/libstub/loongarch.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/firmware/efi/libstub/loongarch.c b/drivers/firmware/efi/libstub/loongarch.c
index 9825f5218137..f7938d5c196a 100644
--- a/drivers/firmware/efi/libstub/loongarch.c
+++ b/drivers/firmware/efi/libstub/loongarch.c
@@ -18,6 +18,11 @@ efi_status_t check_platform_features(void)
return EFI_SUCCESS;
}
+void efi_cache_sync_image(unsigned long image_base, unsigned long alloc_size)
+{
+ asm volatile ("ibar 0" ::: "memory");
+}
+
struct exit_boot_struct {
efi_memory_desc_t *runtime_map;
int runtime_entry_count;
--
2.54.0