From: "tip-bot for H. Peter Anvin" <hpa@linux.intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
yinghai@kernel.org, tglx@linutronix.de, sgruszka@redhat.com,
hpa@linux.intel.com
Subject: [tip:x86/urgent] x86-32: Make sure we can map all of lowmem if we need to
Date: Fri, 17 Dec 2010 03:19:03 GMT [thread overview]
Message-ID: <tip-147dd5610c8d1bacb88a6c1dfdaceaf257946ed0@git.kernel.org> (raw)
In-Reply-To: <4D0AD3ED.8070607@kernel.org>
Commit-ID: 147dd5610c8d1bacb88a6c1dfdaceaf257946ed0
Gitweb: http://git.kernel.org/tip/147dd5610c8d1bacb88a6c1dfdaceaf257946ed0
Author: H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Thu, 16 Dec 2010 19:11:09 -0800
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Thu, 16 Dec 2010 19:11:09 -0800
x86-32: Make sure we can map all of lowmem if we need to
A relocatable kernel can be anywhere in lowmem -- and in the case of a
kdump kernel, is likely to be fairly high. Since the early page
tables map everything from address zero up we need to make sure we
allocate enough brk that we can map all of lowmem if we need to.
Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Tested-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <4D0AD3ED.8070607@kernel.org>
---
arch/x86/boot/compressed/misc.c | 2 +-
arch/x86/kernel/head_32.S | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 23f315c..325c052 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -355,7 +355,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
if (heap > 0x3fffffffffffUL)
error("Destination address too large");
#else
- if (heap > ((-__PAGE_OFFSET-(512<<20)-1) & 0x7fffffff))
+ if (heap > ((-__PAGE_OFFSET-(128<<20)-1) & 0x7fffffff))
error("Destination address too large");
#endif
#ifndef CONFIG_RELOCATABLE
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index bcece91..d7cdf5b 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -60,16 +60,18 @@
#define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD)
#endif
+/* Number of possible pages in the lowmem region */
+LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT)
+
/* Enough space to fit pagetables for the low memory linear map */
-MAPPING_BEYOND_END = \
- PAGE_TABLE_SIZE(((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) << PAGE_SHIFT
+MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT
/*
* Worst-case size of the kernel mapping we need to make:
- * the worst-case size of the kernel itself, plus the extra we need
- * to map for the linear map.
+ * a relocatable kernel can live anywhere in lowmem, so we need to be able
+ * to map all of lowmem.
*/
-KERNEL_PAGES = (KERNEL_IMAGE_SIZE + MAPPING_BEYOND_END)>>PAGE_SHIFT
+KERNEL_PAGES = LOWMEM_PAGES
INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm
RESERVE_BRK(pagetables, INIT_MAP_SIZE)
next prev parent reply other threads:[~2010-12-17 3:21 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 11:16 kdump broken on 2.6.37-rc4 Stanislaw Gruszka
2010-12-03 11:16 ` Stanislaw Gruszka
2010-12-03 15:46 ` Maxim Uvarov
2010-12-03 15:46 ` Maxim Uvarov
2010-12-03 17:11 ` Stanislaw Gruszka
2010-12-03 17:11 ` Stanislaw Gruszka
2010-12-03 17:54 ` Neil Horman
2010-12-03 17:54 ` Neil Horman
2010-12-07 10:50 ` Stanislaw Gruszka
2010-12-07 10:50 ` Stanislaw Gruszka
2010-12-07 19:24 ` Yinghai Lu
2010-12-07 19:24 ` Yinghai Lu
2010-12-08 14:19 ` Stanislaw Gruszka
2010-12-08 14:19 ` Stanislaw Gruszka
2010-12-09 7:16 ` Yinghai Lu
2010-12-09 7:16 ` Yinghai Lu
2010-12-09 12:41 ` Stanislaw Gruszka
2010-12-09 12:41 ` Stanislaw Gruszka
2010-12-09 20:09 ` Yinghai Lu
2010-12-09 20:09 ` Yinghai Lu
2010-12-13 10:08 ` Stanislaw Gruszka
2010-12-13 10:08 ` Stanislaw Gruszka
2010-12-13 18:20 ` Yinghai Lu
2010-12-13 19:47 ` H. Peter Anvin
2010-12-14 22:41 ` Vivek Goyal
2010-12-15 10:39 ` Stanislaw Gruszka
2010-12-15 22:41 ` Yinghai Lu
2010-12-16 4:29 ` Yinghai Lu
2010-12-16 10:00 ` Stanislaw Gruszka
2010-12-16 16:16 ` H. Peter Anvin
2010-12-16 16:22 ` Vivek Goyal
2010-12-16 16:53 ` H. Peter Anvin
2010-12-18 21:50 ` Yinghai Lu
2010-12-16 14:39 ` Vivek Goyal
2010-12-16 16:28 ` H. Peter Anvin
2010-12-16 17:28 ` Yinghai Lu
2010-12-16 19:58 ` H. Peter Anvin
2010-12-16 22:57 ` Yinghai Lu
2010-12-16 23:30 ` Yinghai Lu
2010-12-16 23:49 ` Yinghai Lu
2010-12-17 0:39 ` Yinghai Lu
2010-12-17 1:06 ` H. Peter Anvin
2010-12-17 1:21 ` H. Peter Anvin
2010-12-17 1:51 ` H. Peter Anvin
2010-12-17 3:05 ` Yinghai Lu
2010-12-17 3:07 ` Yinghai Lu
2010-12-17 3:19 ` tip-bot for H. Peter Anvin [this message]
2010-12-17 14:33 ` [tip:x86/urgent] x86-32: Make sure we can map all of lowmem if we need to Stanislaw Gruszka
2010-12-16 22:01 ` kdump broken on 2.6.37-rc4 Vivek Goyal
2010-12-16 22:58 ` Yinghai Lu
2010-12-17 16:15 ` Vivek Goyal
2010-12-17 1:15 ` H. Peter Anvin
2010-12-17 3:31 ` H. Peter Anvin
2010-12-17 3:58 ` Yinghai
2010-12-17 4:08 ` H. Peter Anvin
2010-12-17 4:46 ` Yinghai Lu
2010-12-17 5:16 ` H. Peter Anvin
2010-12-17 17:01 ` Vivek Goyal
2010-12-17 17:56 ` H. Peter Anvin
2010-12-17 18:02 ` Vivek Goyal
2010-12-17 18:21 ` Yinghai Lu
2010-12-17 18:35 ` Vivek Goyal
2010-12-17 19:39 ` H. Peter Anvin
2010-12-17 19:46 ` Yinghai Lu
2010-12-17 19:50 ` Vivek Goyal
2010-12-17 19:52 ` Yinghai Lu
2010-12-17 20:01 ` Vivek Goyal
2010-12-17 20:06 ` Yinghai Lu
2010-12-17 20:34 ` Vivek Goyal
2010-12-17 23:51 ` Vivek Goyal
2010-12-17 19:56 ` H. Peter Anvin
2010-12-17 20:11 ` Vivek Goyal
2010-12-17 20:59 ` H. Peter Anvin
2010-12-17 21:13 ` Vivek Goyal
2010-12-20 16:31 ` Stanislaw Gruszka
2010-12-18 4:34 ` [tip:x86/urgent] x86, kexec: Limit the crashkernel address appropriately tip-bot for H. Peter Anvin
2010-12-17 19:50 ` kdump broken on 2.6.37-rc4 H. Peter Anvin
2010-12-13 10:25 ` Américo Wang
2010-12-13 10:25 ` Américo Wang
2010-12-05 14:35 ` Maciej Rutecki
2010-12-05 14:35 ` Maciej Rutecki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-147dd5610c8d1bacb88a6c1dfdaceaf257946ed0@git.kernel.org \
--to=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=sgruszka@redhat.com \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.