public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: WANG Rui <r@hev.cc>
To: Ard Biesheuvel <ardb@kernel.org>, Huacai Chen <chenhuacai@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	WANG Xuerui <kernel@xen0n.name>,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	loongarch@lists.linux.dev, WANG Rui <r@hev.cc>
Subject: [PATCH v2 0/2] efi/libstub: Ensure instruction cache coherency after kernel relocation
Date: Mon, 27 Apr 2026 16:39:28 +0800	[thread overview]
Message-ID: <20260427083930.36324-1-r@hev.cc> (raw)

Changes since [v1]:
  * Move efi_cache_sync_image() after check_platform_features(), matching arm64.

The EFI stub relocates the kernel image by copying it to a new memory
location using memcpy(). On architectures where the instruction and data
caches are not automatically coherent, the copied instructions may not be
visible to the instruction fetch unit without explicit cache maintenance.

This series adds the missing call to efi_cache_sync_image() in the generic
relocation path, and provides a LoongArch implementation using the ibar
instruction to ensure instruction fetches observe the updated contents.

[v1]: https://lore.kernel.org/loongarch/20260427034451.717817-1-r@hev.cc

WANG Rui (2):
  efi/loongarch: Implement efi_cache_sync_image
  efi/libstub: Synchronize instruction cache after kernel relocation

 drivers/firmware/efi/libstub/loongarch.c | 5 +++++
 drivers/firmware/efi/libstub/relocate.c  | 1 +
 2 files changed, 6 insertions(+)

-- 
2.54.0


             reply	other threads:[~2026-04-27  8:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  8:39 WANG Rui [this message]
2026-04-27  8:39 ` [PATCH v2 1/2] efi/loongarch: Implement efi_cache_sync_image WANG Rui
2026-04-27  8:39 ` [PATCH v2 2/2] efi/libstub: Synchronize instruction cache after kernel relocation WANG Rui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260427083930.36324-1-r@hev.cc \
    --to=r@hev.cc \
    --cc=ardb@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kernel@xen0n.name \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox