Skip to content

alpha: self-extracting compressed kernel images

Matt Turner linux-alpha lkml 2 versions – New

Get series with b4
b4 am [email protected] change-id 20260912-alpha-kernel-compression-2043f806fb75

Versions newest first

  1. v2 Latest3 patches 0 repliesNew
  2. v13 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- Build private copies of the arch/alpha/lib/ memory and division
routines for the stub instead of linking lib.a, whose objects carry
UBSAN/gcov instrumentation and the kernel's -mcpu=. Fixes stub link
failures with UBSAN or GCOV_PROFILE_ALL. (Magnus)
- Build the stub with an explicit -mcpu=ev4.
- Collect trailers.
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3xz: add arch-specific tuning for alphascripts/xz_wrap.sh+5 -00 replies
2/3alpha: add self-extracting compressed kernel boot stubarch/alpha/Kconfig arch/alpha/Makefile arch/alpha/boot/.gitignore +8 more+435 -80 replies
3/3alpha: support the remaining kernel compression formatsarch/alpha/Kconfig arch/alpha/boot/compressed/Makefile arch/alpha/boot/compressed/misc.c+66 -20 replies

Reviews trailers per patch

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

PatchMagnus LindholmLasse Collin
1/3R-b T-b R-b
2/3R-b T-b
3/3R-b T-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] alpha: self-extracting compressed kernel images

Alpha is the last architecture whose boot loader decompresses the kernel
itself: aboot carries its own inflate code, so vmlinux.gz has always been plain gzip, and adding a compression format meant writing a decompressor for aboot as well as for the kernel.

Build a self-extracting image instead, a small ELF stub with the compressed vmlinux linked in, which aboot loads and enters like any other kernel. The compression format then becomes an ordinary kernel Kconfig choice, and all seven formats become available: xz gives the smallest image, 5547496 bytes against 7677280 for the equivalent gzip one. The build now emits arch/alpha/boot/vmlinuz, since the image is no longer gzip data.

The SRM netboot path (bootpz.c) has its own boot protocol and keeps using gzip.

---
Changes in v2:
- Build private copies of the arch/alpha/lib/ memory and division
routines for the stub instead of linking lib.a, whose objects carry
UBSAN/gcov instrumentation and the kernel's -mcpu=. Fixes stub link
failures with UBSAN or GCOV_PROFILE_ALL. (Magnus)
- Build the stub with an explicit -mcpu=ev4.
- Collect trailers.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Matt Turner (3):
xz: add arch-specific tuning for alpha
alpha: add self-extracting compressed kernel boot stub
alpha: support the remaining kernel compression formats

 arch/alpha/Kconfig                       |   7 ++
 arch/alpha/Makefile                      |   6 +-
 arch/alpha/boot/.gitignore               |   2 +
 arch/alpha/boot/Makefile                 |  16 ++-
 arch/alpha/boot/compressed/.gitignore    |   3 +
 arch/alpha/boot/compressed/Makefile      |  89 +++++++++++++
 arch/alpha/boot/compressed/head.S        |  36 ++++++
 arch/alpha/boot/compressed/misc.c        | 209 +++++++++++++++++++++++++++++++
 arch/alpha/boot/compressed/trampoline.S  |  46 +++++++
 arch/alpha/boot/compressed/vmlinux.lds.S |  83 ++++++++++++
 arch/alpha/boot/compressed/vmlinux.scr   |  10 ++
 scripts/xz_wrap.sh                       |   5 +
 12 files changed, 504 insertions(+), 8 deletions(-)

---
base-commit: 4407825b2f96b0e48a4bd08ab196b50a30eb3aef
change-id: 20260912-alpha-kernel-compression-2043f806fb75

Best regards,

Signature · 1 line
Matt Turner <[email protected]>