Skip to content

arm64: head: pad Image header to 64 KB and unmap it

Ard Biesheuvel linux-arm-kernel 2 versions – Applied

Status from this message: Applied to arm64 (for-next/pad-image-header), thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v14 patches 9 repliesSuperseded

Changes in v2 from the cover letter

- drop the original first patch that fixed the actual bug - it has already been merged
- add Will's acks
- use a better NOP and a better name for the macro that emits it (#3)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3arm64: omit [_text, _stext) from permanent kernel mappingarch/arm64/kernel/efi-header.S arch/arm64/kernel/setup.c arch/arm64/kernel/vmlinux.lds.S +2 more+9 -160 replies
2/3arm64/head: avoid symbol names pointing into first 64 KB of kernel imagearch/arm64/kernel/efi-header.S+22 -240 replies
3/3arm64: head: tidy up the Image header definitionarch/arm64/kernel/efi-header.S arch/arm64/kernel/head.S+35 -270 replies

Reviews trailers per patch

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

PatchWill Deacon
1/3A-b
2/3A-b
3/3A-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 [PATCH v2 0/3] arm64: head: pad Image header to 64 KB and unmap it

The EFI header definition was updated recently to increase the section alignment to 64 KB, which causes the EFI loader to put the kernel Image at an offset that is guaranteed to be compatible with the kernel's image placement policy when CONFIG_RELOCATABLE=y, removing the need to move it around in DRAM before boot.

This change failed to take into account that the first section in the PE/COFF description should start at a 64 KB aligned boundary as well, and so even though EFI loaders don't seem to care, the current PE/COFF layout is not 100% compliant.

So let's fix this by padding the size of the .head region to 64 KB, and while at it, removing it from the kernel's executable mapping, which is now guaranteed to be possible regardless of the page size the kernel is running with. And if we don't map it, we don't need to reserve it either.

Changes since v1:
- drop the original first patch that fixed the actual bug - it has already been merged
- add Will's acks
- use a better NOP and a better name for the macro that emits it (#3)

Ard Biesheuvel (3):
arm64: omit [_text, _stext) from permanent kernel mapping arm64/head: avoid symbol names pointing into first 64 KB of kernel
image
arm64: head: tidy up the Image header definition

 arch/arm64/kernel/efi-header.S  | 84 ++++++++++++--------
 arch/arm64/kernel/head.S        | 19 +----
 arch/arm64/kernel/setup.c       |  4 +-
 arch/arm64/kernel/vmlinux.lds.S |  2 +-
 arch/arm64/mm/init.c            |  2 +-
 arch/arm64/mm/mmu.c             | 10 +--
 6 files changed, 60 insertions(+), 61 deletions(-)
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel