All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] RFC: x86: relocatable kernel changes
@ 2009-05-07 22:26 ` H. Peter Anvin
  0 siblings, 0 replies; 90+ messages in thread
From: H. Peter Anvin @ 2009-05-07 22:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: vgoyal, hbabu, kexec, ying.huang, mingo, tglx, ebiederm, sam

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(-)

^ permalink raw reply	[flat|nested] 90+ messages in thread

end of thread, other threads:[~2009-05-11 18:02 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-07 22:26 [PATCH 00/14] RFC: x86: relocatable kernel changes H. Peter Anvin
2009-05-07 22:26 ` H. Peter Anvin
2009-05-07 22:26 ` [PATCH 01/14] x86, boot: align the .bss section in the decompressor H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-08  7:17   ` Sam Ravnborg
2009-05-08  7:17     ` Sam Ravnborg
2009-05-08  8:18     ` Eric Dumazet
2009-05-08  8:18       ` Eric Dumazet
2009-05-08 16:54     ` H. Peter Anvin
2009-05-08 16:54       ` H. Peter Anvin
2009-05-08  7:53   ` Cyrill Gorcunov
2009-05-08  7:53     ` Cyrill Gorcunov
2009-05-08 17:03     ` H. Peter Anvin
2009-05-08 17:03       ` H. Peter Anvin
2009-05-08 17:15       ` Cyrill Gorcunov
2009-05-08 17:15         ` Cyrill Gorcunov
2009-05-08 17:21         ` H. Peter Anvin
2009-05-08 17:21           ` H. Peter Anvin
2009-05-07 22:26 ` [PATCH 02/14] x86, boot: honor CONFIG_PHYSICAL_START when relocatable H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-08  7:34   ` Sam Ravnborg
2009-05-08  7:34     ` Sam Ravnborg
2009-05-08 16:58     ` H. Peter Anvin
2009-05-08 16:58       ` H. Peter Anvin
2009-05-07 22:26 ` [PATCH 03/14] x86, config: change defaults PHYSICAL_START and PHYSICAL_ALIGN H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-08  7:36   ` Sam Ravnborg
2009-05-08  7:36     ` Sam Ravnborg
2009-05-08  9:47     ` Ingo Molnar
2009-05-08  9:47       ` Ingo Molnar
2009-05-08 17:01     ` H. Peter Anvin
2009-05-08 17:01       ` H. Peter Anvin
2009-05-07 22:26 ` [PATCH 04/14] x86, boot: unify use LOAD_PHYSICAL_ADDR and LOAD_PHYSICAL_ALIGN H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-07 22:26 ` [PATCH 05/14] kbuild: allow compressors (gzip, bzip2, lzma) to take multiple inputs H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-08  7:42   ` Sam Ravnborg
2009-05-08  7:42     ` Sam Ravnborg
2009-05-08 20:18     ` H. Peter Anvin
2009-05-08 20:18       ` H. Peter Anvin
2009-05-08 20:47       ` Sam Ravnborg
2009-05-08 20:47         ` Sam Ravnborg
2009-05-08 20:49         ` H. Peter Anvin
2009-05-08 20:49           ` H. Peter Anvin
2009-05-08 21:33           ` Sam Ravnborg
2009-05-08 21:33             ` Sam Ravnborg
2009-05-07 22:26 ` [PATCH 06/14] x86: add a Kconfig symbol for when relocations are needed H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-07 22:26 ` [PATCH 07/14] x86, boot: simplify arch/x86/boot/compressed/Makefile H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-08  7:45   ` Sam Ravnborg
2009-05-08  7:45     ` Sam Ravnborg
2009-05-07 22:26 ` [PATCH 08/14] x86, boot: use BP_scratch in arch/x86/boot/compressed/head_*.S H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-07 22:26 ` [PATCH 09/14] x86, boot: add new runtime_address and runtime_size bzImage fields H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-08  7:55   ` Sam Ravnborg
2009-05-08  7:55     ` Sam Ravnborg
2009-05-08 21:09     ` H. Peter Anvin
2009-05-08 21:09       ` H. Peter Anvin
2009-05-08 21:35       ` Sam Ravnborg
2009-05-08 21:35         ` Sam Ravnborg
2009-05-07 22:26 ` [PATCH 10/14] x86, doc: document the runtime_start " H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-07 22:26 ` [PATCH 11/14] x86, boot: use rep movsq to move kernel on 64 bits H. Peter Anvin
2009-05-07 22:26   ` H. Peter Anvin
2009-05-07 22:27 ` [PATCH 12/14] x86, boot: zero EFLAGS on 32 bits H. Peter Anvin
2009-05-07 22:27   ` H. Peter Anvin
2009-05-07 22:27 ` [PATCH 13/14] x86: make CONFIG_RELOCATABLE the default H. Peter Anvin
2009-05-07 22:27   ` H. Peter Anvin
2009-05-07 22:27 ` [PATCH 14/14] x86, defconfig: update defconfigs to relocatable H. Peter Anvin
2009-05-07 22:27   ` H. Peter Anvin
2009-05-08  1:23 ` [PATCH 00/14] RFC: x86: relocatable kernel changes Eric W. Biederman
2009-05-08  1:23   ` Eric W. Biederman
2009-05-08  5:31   ` H. Peter Anvin
2009-05-08  5:31     ` H. Peter Anvin
2009-05-08  6:54     ` Eric W. Biederman
2009-05-08  6:54       ` Eric W. Biederman
2009-05-08 18:04       ` H. Peter Anvin
2009-05-08 18:04         ` H. Peter Anvin
2009-05-08 18:47       ` H. Peter Anvin
2009-05-08 18:47         ` H. Peter Anvin
2009-05-11  5:18         ` RFC: x86: relocatable kernel changes (revised spec) H. Peter Anvin
2009-05-11  5:18           ` H. Peter Anvin
2009-05-11 11:54           ` Eric W. Biederman
2009-05-11 11:54             ` Eric W. Biederman
2009-05-11 16:03             ` H. Peter Anvin
2009-05-11 16:03               ` H. Peter Anvin
2009-05-11 17:56             ` RFC: x86: relocatable kernel changes (revised spec v2) H. Peter Anvin
2009-05-11 17:56               ` H. Peter Anvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.