summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/head_64.S
diff options
context:
space:
mode:
authorH. Peter Anvin2009-05-12 00:56:08 +0200
committerH. Peter Anvin2009-05-12 02:44:39 +0200
commit37ba7ab5e33cebc25c68fffe33e9f21e7c2014e8 (patch)
tree006ba60fcd29b8fdee844ee6d90b85104a254d0d /arch/x86/boot/compressed/head_64.S
parentx86, boot: remove dead code from boot/compressed/head_*.S (diff)
downloadkernel-qcow2-linux-37ba7ab5e33cebc25c68fffe33e9f21e7c2014e8.tar.gz
kernel-qcow2-linux-37ba7ab5e33cebc25c68fffe33e9f21e7c2014e8.tar.xz
kernel-qcow2-linux-37ba7ab5e33cebc25c68fffe33e9f21e7c2014e8.zip
x86, boot: make kernel_alignment adjustable; new bzImage fields
Make the kernel_alignment field adjustable; this allows us to set it to a large value (intended to be 16 MB to avoid ZONE_DMA contention, memory holes and other weirdness) while a smart bootloader can still force a loading at a lesser alignment if absolutely necessary. Also export pref_address (preferred loading address, corresponding to the link-time address) and init_size, the total amount of linear memory the kernel will require during initialization. [ Impact: allows better kernel placement, gives bootloader more info ] Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/boot/compressed/head_64.S')
-rw-r--r--arch/x86/boot/compressed/head_64.S14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 2bb500af1bd7..f62c284db9eb 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -84,8 +84,11 @@ ENTRY(startup_32)
#ifdef CONFIG_RELOCATABLE
movl %ebp, %ebx
- addl $(PMD_PAGE_SIZE -1), %ebx
- andl $PMD_PAGE_MASK, %ebx
+ movl BP_kernel_alignment(%esi), %eax
+ decl %eax
+ addl %eax, %ebx
+ notl %eax
+ andl %eax, %ebx
#else
movl $LOAD_PHYSICAL_ADDR, %ebx
#endif
@@ -224,8 +227,11 @@ ENTRY(startup_64)
/* Start with the delta to where the kernel will run at. */
#ifdef CONFIG_RELOCATABLE
leaq startup_32(%rip) /* - $startup_32 */, %rbp
- addq $(PMD_PAGE_SIZE - 1), %rbp
- andq $PMD_PAGE_MASK, %rbp
+ movl BP_kernel_alignment(%rsi), %eax
+ decl %eax
+ addq %rax, %rbp
+ notq %rax
+ andq %rax, %rbp
#else
movq $LOAD_PHYSICAL_ADDR, %rbp
#endif