RFC: x86: relocatable kernel changes
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest14 patches 30 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | x86, boot: align the .bss section in the decompressorarch/ | +1 | 7 replies | |
| 2/14 | x86, boot: honor CONFIG_PHYSICAL_START when relocatablearch/ arch/ | +61 | 2 replies | |
| 3/14 | x86, config: change defaults PHYSICAL_START and PHYSICAL_ALIGNarch/ | +11 | 3 replies | |
| 4/14 | x86, boot: unify use LOAD_PHYSICAL_ADDR and LOAD_PHYSICAL_ALIGNarch/ arch/ arch/ +1 more | +23 | 0 replies | |
| 5/14 | kbuild: allow compressors (gzip, bzip2, lzma) to take multiple inputsscripts/ scripts/ | +14 | 5 replies | |
| 6/14 | x86: add a Kconfig symbol for when relocations are neededarch/ | +5 | 0 replies | |
| 7/14 | x86, boot: simplify arch/x86/boot/compressed/Makefilearch/ | +6 | 1 reply | |
| 8/14 | x86, boot: use BP_scratch in arch/x86/boot/compressed/head_*.Sarch/ arch/ | +2 | 0 replies | |
| 9/14 | x86, boot: add new runtime_address and runtime_size bzImage fieldsarch/ arch/ arch/ +7 more | +173 | 3 replies | |
| 10/14 | x86, doc: document the runtime_start and runtime_size bzImage fieldsDocumentation/ | +41 | 0 replies | |
| 11/14 | x86, boot: use rep movsq to move kernel on 64 bitsarch/ | +23 | 0 replies | |
| 12/14 | x86, boot: zero EFLAGS on 32 bitsarch/ | +8 | 0 replies | |
| 13/14 | x86: make CONFIG_RELOCATABLE the defaultarch/ | +2 | 0 replies | |
| 14/14 | x86, defconfig: update defconfigs to relocatablearch/ arch/ | +226 | 0 replies |
Reviews trailers per patch
2 of 14 patches have a Reviewed-by or Acked-by.
| Patch | Sam Ravnborg |
|---|---|
| 1/14 | |
| 2/14 | |
| 3/14 | |
| 4/14 | |
| 5/14 | A-b A-b |
| 6/14 | |
| 7/14 | A-b |
| 8/14 | |
| 9/14 | |
| 10/14 | |
| 11/14 | |
| 12/14 | |
| 13/14 | |
| 14/14 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/14] RFC: x86: relocatable kernel changes
This series is currently in -tip; the goal of it is to make the semantics of the relocatable kernel fully the same as the non-relocatable kernel when loaded by a relocating bootloader. That means CONFIG_PHYSICAL_START is honored to (a) be able to keep ZONE_DMA free, and avoid the once-again-increasingly-common 15-16 MB hole (don't ask me *why* this abortion is cropping up again, but I'm seeing an increasing number of reports to the effect that it *is*) and (b) make vmlinux match the runtime code in the normal case.
To deal with that constraint, CONFIG_PHYSICAL_START is taken as a minimum address for the kernel. Since a relocating bootloader may have real reasons to load the kernel lower than that (for example, because it has detected that it is on a small-memory system), this adds two new fields to the bzImage header:
runtime_start - CONFIG_PHYSICAL_START
runtime_size - The contiguous memory space consumed by the kernel
The latter is the union of contiguous memory consumed by the kernel during decompression and initialization; this is now possible thanks to Jeremy's .brk patchset. This isn't the same thing as the amount of memory the kernel needs, but rather the amount of memory it will assume that it can use before it starts to be able to read the memory map.
The runtime_start field can be *written* by the bootloader if the kernel is relocatable; e.g. by setting it to zero to indicate that the load address should be used no matter what.
The physical address at which the kernel starts is now:
align_up(max(load_address, runtime_start), kernel_alignment)
This seems to be the best possible compromise between the current behaviors for relocatable and non-relocatable kernels.
This patchset also bumps up the default alignment to a PMD boundary (2 MB for x86-64 and PAE; 4 MB for !PAE). I also change the default CONFIG_PHYSICAL_START to 16 MB (4 MB for CONFIG_EMBEDDED).
The patchset also includes some plain optimizations.
Documentation/x86/boot.txt | 41 +++++++++ arch/x86/Kconfig | 28 ++++-- arch/x86/boot/Makefile | 24 ++++-- arch/x86/boot/compressed/Makefile | 51 +++-------- arch/x86/boot/compressed/head_32.S | 131 +++++++++++++--------------- arch/x86/boot/compressed/head_64.S | 129 ++++++++++++---------------- arch/x86/boot/compressed/mkpiggy.c | 97 +++++++++++++++++++++ arch/x86/boot/compressed/vmlinux.lds.S | 1 + arch/x86/boot/compressed/vmlinux.scr | 10 -- arch/x86/boot/header.S | 21 ++++- arch/x86/configs/i386_defconfig | 148 ++++++++++++++++++++++++------- arch/x86/configs/x86_64_defconfig | 148 ++++++++++++++++++++++++-------- arch/x86/include/asm/boot.h | 13 +++- arch/x86/include/asm/bootparam.h | 2 + arch/x86/kernel/asm-offsets_32.c | 1 + arch/x86/kernel/asm-offsets_64.c | 1 + scripts/Makefile.lib | 11 ++- scripts/bin_size | 8 ++- 18 files changed, 575 insertions(+), 290 deletions(-)
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec