Skip to content

efi/libstub: Ensure instruction cache coherency after kernel relocation

WANG Rui linux-efi lkml loongarch 3 versions Applied

Status from this message: Queued up in efi/urgent - thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/22 patches 3 repliesApplied
  2. v2 posting 1/22 patches 0 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

* Move efi_cache_sync_image() after check_platform_features(), matching arm64.
* Add "()" after function name in the subject.

Patches in v2 posting 2/2 Applied

#Subject and filesSizeRepliesApplied
1/2efi/loongarch: Implement efi_cache_sync_image()drivers/firmware/efi/libstub/loongarch.c+5 -00 replies
2/2efi/libstub: Synchronize instruction cache after kernel relocationdrivers/firmware/efi/libstub/relocate.c+1 -00 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchHuacai Chen
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [RESEND PATCH v2 0/2] efi/libstub: Ensure instruction cache coherency after kernel relocation

Changes since [v1]:
* Move efi_cache_sync_image() after check_platform_features(), matching arm64.
* Add "()" after function name in the subject.

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/[email protected]

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(+)
Signature · 1 line
2.54.0