]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
efi/loongarch: Implement efi_cache_sync_image()
authorWANG Rui <r@hev.cc>
Mon, 27 Apr 2026 08:47:20 +0000 (16:47 +0800)
committerArd Biesheuvel <ardb@kernel.org>
Wed, 29 Apr 2026 06:56:16 +0000 (08:56 +0200)
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@hev.cc>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/loongarch.c

index 9825f5218137f26a67c44b796102752b69b1139d..f7938d5c196aad573f63493a23fee0ef0fdc5bf4 100644 (file)
@@ -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;