Re: [PATCH 1/2] efi/loongarch: Implement efi_cache_sync_image
From: Huacai Chen
Date: Mon Apr 27 2026 - 04:09:09 EST
Hi, Rui,
On Mon, Apr 27, 2026 at 11:45 AM WANG Rui <r@xxxxxx> wrote:
>
> Provide a LoongArch implementation of efi_cache_sync_image() to ensure
> instruction cache coherency after the kernel image is relocated.
Please also add "()" after function name in the subject.
>
> Signed-off-by: WANG Rui <r@xxxxxx>
> ---
> 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..26495747f69f 100644
> --- a/drivers/firmware/efi/libstub/loongarch.c
> +++ b/drivers/firmware/efi/libstub/loongarch.c
> @@ -82,3 +82,8 @@ efi_status_t efi_boot_kernel(void *handle, efi_loaded_image_t *image,
> real_kernel_entry(true, (unsigned long)cmdline_ptr,
> (unsigned long)efi_system_table);
> }
> +
> +void efi_cache_sync_image(unsigned long image_base, unsigned long alloc_size)
> +{
> + asm volatile ("ibar 0" ::: "memory");
> +}
Please move it after check_platform_features(), which is the same as arm64.
Others look good to me.
Reviewed-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>
> --
> 2.54.0
>
>