From: Yinghai Lu <yinghai@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
"'Russell King - ARM Linux'" <linux@arm.linux.org.uk>,
Kevin Hilman <khilman@linaro.org>,
Olof Johansson <olof@lixom.net>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Dave Hansen <dave.hansen@intel.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
linux-kernel@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH] memblock: Add limit checking to memblock_virt_alloc
Date: Tue, 28 Jan 2014 14:04:25 -0800 [thread overview]
Message-ID: <1390946665-2967-1-git-send-email-yinghai@kernel.org> (raw)
In original bootmem wrapper for memblock, we have limit checking.
Add it to memblock_virt_alloc, to address arm and x86 booting crash.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
mm/memblock.c | 3 +++
1 file changed, 3 insertions(+)
Index: linux-2.6/mm/memblock.c
===================================================================
--- linux-2.6.orig/mm/memblock.c
+++ linux-2.6/mm/memblock.c
@@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc
if (!align)
align = SMP_CACHE_BYTES;
+ if (max_addr > memblock.current_limit)
+ max_addr = memblock.current_limit;
+
again:
alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
nid);
next reply other threads:[~2014-01-28 22:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 22:04 Yinghai Lu [this message]
2014-01-28 22:08 ` Dave Hansen
2014-01-28 22:47 ` Yinghai Lu
2014-01-28 22:55 ` Dave Hansen
2014-01-29 1:50 ` Konrad Rzeszutek Wilk
2014-01-29 23:07 ` Tony Luck
2014-01-29 23:39 ` Yinghai Lu
2014-01-29 23:53 ` Yinghai Lu
2014-01-30 0:12 ` Tony Luck
2014-01-30 0:34 ` Andrew Morton
2014-01-30 0:46 ` Tony Luck
2014-01-28 22:08 ` Andrew Morton
2014-01-28 22:08 ` Olof Johansson
2014-01-29 1:25 ` Kevin Hilman
2014-01-30 4:46 ` Sachin Kamat
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=1390946665-2967-1-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=khilman@linaro.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@elte.hu \
--cc=olof@lixom.net \
--cc=santosh.shilimkar@ti.com \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®